Skip to content

Commit

Permalink
Merge pull request #8 from subspace/add-fn-to-get-recorded-keys
Browse files Browse the repository at this point in the history
Add function to get recorded keys from proof recorder instance
  • Loading branch information
ParthDesai authored Dec 1, 2023
2 parents 892bf8e + a54f2df commit 4c82ce2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions substrate/primitives/trie/src/recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ impl<H: Hasher> Clone for Recorder<H> {
}

impl<H: Hasher> Recorder<H> {
/// Returns [`RecordedForKey`] per recorded key per trie.
///
/// There are multiple tries when working with e.g. child tries.
pub fn recorded_keys(&self) -> HashMap<<H as Hasher>::Out, HashMap<Arc<[u8]>, RecordedForKey>> {
self.inner.lock().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 4c82ce2

Please sign in to comment.