Skip to content

Commit

Permalink
add function to get recorded keys from proof recorder instance
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthDesai committed Nov 29, 2023
1 parent 892bf8e commit 0717b42
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions substrate/primitives/trie/src/recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ impl<H: Hasher> Clone for Recorder<H> {
}

impl<H: Hasher> Recorder<H> {
/// Keys for which we have recorded the trie nodes till now.
/// Note that this does not modify the internals, rather returns snapshot of the recorded keys.
/// There can be multiple storage root in case we are tracking more than one tries.
pub fn recorded_keys(&self) -> HashMap<<H as Hasher>::Out, HashMap<Arc<[u8]>, RecordedForKey>> {
let inner = self.inner.lock();
inner.recorded_keys.clone()
}


/// Returns the recorder as [`TrieRecorder`](trie_db::TrieRecorder) compatible type.
///
/// - `storage_root`: The storage root of the trie for which accesses are recorded. This is
Expand Down

0 comments on commit 0717b42

Please sign in to comment.