Trait casper_execution_engine::storage::global_state::StateProvider[][src]

pub trait StateProvider {
    type Error;
    type Reader: StateReader<Key, StoredValue, Error = Self::Error>;
    fn checkout(
        &self,
        state_hash: Blake2bHash
    ) -> Result<Option<Self::Reader>, Self::Error>;
fn commit(
        &self,
        correlation_id: CorrelationId,
        state_hash: Blake2bHash,
        effects: AdditiveMap<Key, Transform>
    ) -> Result<CommitResult, Self::Error>;
fn put_protocol_data(
        &self,
        protocol_version: ProtocolVersion,
        protocol_data: &ProtocolData
    ) -> Result<(), Self::Error>;
fn get_protocol_data(
        &self,
        protocol_version: ProtocolVersion
    ) -> Result<Option<ProtocolData>, Self::Error>;
fn empty_root(&self) -> Blake2bHash;
fn read_trie(
        &self,
        correlation_id: CorrelationId,
        trie_key: &Blake2bHash
    ) -> Result<Option<Trie<Key, StoredValue>>, Self::Error>;
fn put_trie(
        &self,
        correlation_id: CorrelationId,
        trie: &Trie<Key, StoredValue>
    ) -> Result<Blake2bHash, Self::Error>;
fn missing_trie_keys(
        &self,
        correlation_id: CorrelationId,
        trie_keys: Vec<Blake2bHash>
    ) -> Result<Vec<Blake2bHash>, Self::Error>; }

Associated Types

Loading content...

Required methods

fn checkout(
    &self,
    state_hash: Blake2bHash
) -> Result<Option<Self::Reader>, Self::Error>
[src]

Checkouts to the post state of a specific block.

fn commit(
    &self,
    correlation_id: CorrelationId,
    state_hash: Blake2bHash,
    effects: AdditiveMap<Key, Transform>
) -> Result<CommitResult, Self::Error>
[src]

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

fn put_protocol_data(
    &self,
    protocol_version: ProtocolVersion,
    protocol_data: &ProtocolData
) -> Result<(), Self::Error>
[src]

fn get_protocol_data(
    &self,
    protocol_version: ProtocolVersion
) -> Result<Option<ProtocolData>, Self::Error>
[src]

fn empty_root(&self) -> Blake2bHash[src]

fn read_trie(
    &self,
    correlation_id: CorrelationId,
    trie_key: &Blake2bHash
) -> Result<Option<Trie<Key, StoredValue>>, Self::Error>
[src]

Reads a Trie from the state if it is present

fn put_trie(
    &self,
    correlation_id: CorrelationId,
    trie: &Trie<Key, StoredValue>
) -> Result<Blake2bHash, Self::Error>
[src]

Insert a trie node into the trie

fn missing_trie_keys(
    &self,
    correlation_id: CorrelationId,
    trie_keys: Vec<Blake2bHash>
) -> Result<Vec<Blake2bHash>, Self::Error>
[src]

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

Loading content...

Implementors

impl StateProvider for InMemoryGlobalState[src]

type Error = Error

type Reader = InMemoryGlobalStateView

fn missing_trie_keys(
    &self,
    correlation_id: CorrelationId,
    trie_keys: Vec<Blake2bHash>
) -> Result<Vec<Blake2bHash>, Self::Error>
[src]

Finds all of the keys of missing descendant Trie<Key,StoredValue> values

impl StateProvider for LmdbGlobalState[src]

type Error = Error

type Reader = LmdbGlobalStateView

fn missing_trie_keys(
    &self,
    correlation_id: CorrelationId,
    trie_keys: Vec<Blake2bHash>
) -> Result<Vec<Blake2bHash>, Self::Error>
[src]

Finds all of the keys of missing descendant Trie<K,V> values

Loading content...