diff --git a/substrate/primitives/trie/src/recorder.rs b/substrate/primitives/trie/src/recorder.rs index 154cee3f37dc..6d620e451fe8 100644 --- a/substrate/primitives/trie/src/recorder.rs +++ b/substrate/primitives/trie/src/recorder.rs @@ -105,6 +105,15 @@ impl Clone for Recorder { } impl Recorder { + /// 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<::Out, HashMap, 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