Trait sp_trie::TrieRecorder

pub trait TrieRecorder<H> {
    // Required methods
    fn record<'a>(&mut self, access: TrieAccess<'a, H>);
    fn trie_nodes_recorded_for_key(&self, key: &[u8]) -> RecordedForKey;
}
Expand description

Various re-exports from the trie-db crate. A trie recorder that can be used to record all kind of [TrieAccess]’s.

To build a trie proof a recorder is required that records all trie accesses. These recorded trie accesses can then be used to create the proof.

Required Methods§

fn record<'a>(&mut self, access: TrieAccess<'a, H>)

Record the given [TrieAccess].

Depending on the [TrieAccess] a call of Self::trie_nodes_recorded_for_key afterwards must return the correct recorded state.

fn trie_nodes_recorded_for_key(&self, key: &[u8]) -> RecordedForKey

Check if we have recorded any trie nodes for the given key.

Returns [RecordedForKey] to express the state of the recorded trie nodes.

Implementors§

§

impl<L> TrieRecorder<<<L as TrieLayout>::Hash as Hasher>::Out> for Recorder<L>where L: TrieLayout,