Trait aptos_state_view::StateView
source · [−]pub trait StateView: Sync {
fn get_state_value(&self, state_key: &StateKey) -> Result<Option<Vec<u8>>>;
fn is_genesis(&self) -> bool;
fn id(&self) -> StateViewId { ... }
}Expand description
StateView is a trait that defines a read-only snapshot of the global state. It is passed to
the VM for transaction execution, during which the VM is guaranteed to read anything at the
given state.
Required Methods
Gets the state value for a given state key.
fn is_genesis(&self) -> bool
fn is_genesis(&self) -> bool
VM needs this method to know whether the current state view is for genesis state creation. Currently TransactionPayload::WriteSet is only valid for genesis state creation.
Provided Methods
fn id(&self) -> StateViewId
fn id(&self) -> StateViewId
For logging and debugging purpose, identifies what this view is for.