Add Process::get_process_id()
This commit is contained in:
parent
66536eaa00
commit
18dd726cce
@ -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> {
|
pub fn get_last_unspent_outpoint(&self) -> anyhow::Result<OutPoint> {
|
||||||
if self.states.is_empty() { return Err(anyhow::Error::msg("Empty Process")); }
|
if self.states.is_empty() { return Err(anyhow::Error::msg("Empty Process")); }
|
||||||
let last_state = self.states.last().unwrap();
|
let last_state = self.states.last().unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user