Skip to content

Commit

Permalink
add Stock::trace iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 21, 2024
1 parent 8d2d112 commit f5278ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/stock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ impl<S: Supply<CAPS>, const CAPS: u32> Stock<S, CAPS> {

pub fn operation(&mut self, opid: Opid) -> Operation { self.supply.stash_mut().read(opid) }

pub fn trace(&mut self) -> impl Iterator<Item = (Opid, Transition)> + use<'_, S, CAPS> {
self.supply.trace_mut().iter()
}

pub fn start_deed(&mut self, method: impl Into<MethodName>) -> DeedBuilder<'_, S, CAPS> {
let builder = OpBuilder::new(self.articles.contract.contract_id(), self.articles.schema.call_id(method));
DeedBuilder { builder, stock: self }
Expand Down

0 comments on commit f5278ec

Please sign in to comment.