Add Process::get_process_id()
This commit is contained in:
parent
8a5beeacc7
commit
fff051b12c
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user