logo
pub trait StateProvider {
    type Error;
    type Reader: StateReader<Key, StoredValue, Error = Self::Error>;
    fn checkout(
        &self,
        state_hash: Digest
    ) -> Result<Option<Self::Reader>, Self::Error>; fn commit(
        &self,
        correlation_id: CorrelationId,
        state_hash: Digest,
        effects: AdditiveMap<Key, Transform>
    ) -> Result<Digest, Self::Error>; fn empty_root(&self) -> Digest; fn get_trie(
        &self,
        correlation_id: CorrelationId,
        trie_key: &Digest
    ) -> Result<Option<Trie<Key, StoredValue>>, Self::Error>; fn put_trie(
        &self,
        correlation_id: CorrelationId,
        trie: &Trie<Key, StoredValue>
    ) -> Result<Digest, Self::Error>; fn missing_trie_keys(
        &self,
        correlation_id: CorrelationId,
        trie_keys: Vec<Digest>
    ) -> Result<Vec<Digest>, Self::Error>; }
Expand description

A trait expressing operations over the trie.

Associated Types

Associated error type for StateProvider.

Associated reader type for StateProvider.

Required methods

Checkouts to the post state of a specific block.

Applies changes and returns a new post state hash. block_hash is used for computing a deterministic and unique keys.

Returns an empty root hash.

Reads a Trie from the state if it is present

Insert a trie node into the trie

Finds all of the missing or corrupt keys of which are descendants of trie_key

Implementors