Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to get recorded keys from proof recorder instance #8

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading