Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit acb4306

Browse files
austbotngundotra
andauthored
Add GetSeq to CMT (#4059)
Co-authored-by: Noah Gundotra <[email protected]>
1 parent e564c79 commit acb4306

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

account-compression/Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libraries/concurrent-merkle-tree/src/concurrent_merkle_tree.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,12 @@ impl<const MAX_DEPTH: usize, const MAX_BUFFER_SIZE: usize>
366366
}
367367
}
368368

369+
/// Returns the Current Seq of the tree, the seq is the monotonic counter of the tree operations
370+
/// that is incremented every time a mutable operation is performed on the tree.
371+
pub fn get_seq(&self) -> u64 {
372+
self.sequence_number
373+
}
374+
369375
/// Modifies the `proof` for leaf at `leaf_index`
370376
/// in place by fast-forwarding the given `proof` through the
371377
/// `changelog`s, starting at index `changelog_buffer_index`

0 commit comments

Comments
 (0)