Skip to content

Commit

Permalink
chore: add store_mut fn to MMRBatch
Browse files Browse the repository at this point in the history
  • Loading branch information
quake committed Jul 27, 2023
1 parent f2a3211 commit 267702a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@ impl<T, M, S> MMR<T, M, S> {
&self.batch
}

pub fn batch_mut(&mut self) -> &mut MMRBatch<T, S> {
&mut self.batch
}

pub fn store(&self) -> &S {
self.batch.store()
}

pub fn store_mut(&mut self) -> &mut S {
self.batch.store_mut()
}
}

impl<T: Clone + PartialEq, M: Merge<Item = T>, S: MMRStoreReadOps<T>> MMR<T, M, S> {
Expand Down
4 changes: 4 additions & 0 deletions src/mmr_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ impl<Elem, Store> MMRBatch<Elem, Store> {
pub fn store(&self) -> &Store {
&self.store
}

pub fn store_mut(&mut self) -> &mut Store {
&mut self.store
}
}

impl<Elem: Clone, Store: MMRStoreReadOps<Elem>> MMRBatch<Elem, Store> {
Expand Down

0 comments on commit 267702a

Please sign in to comment.