Add Process::get_process_id()

This commit is contained in:
Sosthene 2024-12-12 15:50:15 +01:00
parent 8a5beeacc7
commit fff051b12c

View File

@ -250,6 +250,10 @@ impl Process {
}
}
pub fn get_process_id(&self) -> anyhow::Result<OutPoint> {
Ok(self.states.get(0).ok_or(anyhow::Error::msg("Empty state list"))?.commited_in)
}
pub fn get_last_unspent_outpoint(&self) -> anyhow::Result<OutPoint> {
if self.states.is_empty() { return Err(anyhow::Error::msg("Empty Process")); }
let last_state = self.states.last().unwrap();