From fff051b12cae9084e55389d18deacf35237d6bf6 Mon Sep 17 00:00:00 2001 From: Sosthene Date: Thu, 12 Dec 2024 15:50:15 +0100 Subject: [PATCH] Add Process::get_process_id() --- src/process.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/process.rs b/src/process.rs index b3fcec2..5498ddd 100644 --- a/src/process.rs +++ b/src/process.rs @@ -250,6 +250,10 @@ impl Process { } } + pub fn get_process_id(&self) -> anyhow::Result { + Ok(self.states.get(0).ok_or(anyhow::Error::msg("Empty state list"))?.commited_in) + } + pub fn get_last_unspent_outpoint(&self) -> anyhow::Result { if self.states.is_empty() { return Err(anyhow::Error::msg("Empty Process")); } let last_state = self.states.last().unwrap();