Trait linera_execution::BaseRuntime

source ·
pub trait BaseRuntime {
    type Read: Debug + Send + Sync;
    type ContainsKey: Debug + Send + Sync;
    type ContainsKeys: Debug + Send + Sync;
    type ReadMultiValuesBytes: Debug + Send + Sync;
    type ReadValueBytes: Debug + Send + Sync;
    type FindKeysByPrefix: Debug + Send + Sync;
    type FindKeyValuesByPrefix: Debug + Send + Sync;

Show 32 methods // Required methods fn chain_id(&mut self) -> Result<ChainId, ExecutionError>; fn block_height(&mut self) -> Result<BlockHeight, ExecutionError>; fn application_id(&mut self) -> Result<UserApplicationId, ExecutionError>; fn application_creator_chain_id( &mut self, ) -> Result<ChainId, ExecutionError>; fn application_parameters(&mut self) -> Result<Vec<u8>, ExecutionError>; fn read_system_timestamp(&mut self) -> Result<Timestamp, ExecutionError>; fn read_chain_balance(&mut self) -> Result<Amount, ExecutionError>; fn read_owner_balance( &mut self, owner: AccountOwner, ) -> Result<Amount, ExecutionError>; fn read_owner_balances( &mut self, ) -> Result<Vec<(AccountOwner, Amount)>, ExecutionError>; fn read_balance_owners( &mut self, ) -> Result<Vec<AccountOwner>, ExecutionError>; fn chain_ownership(&mut self) -> Result<ChainOwnership, ExecutionError>; fn contains_key_new( &mut self, key: Vec<u8>, ) -> Result<Self::ContainsKey, ExecutionError>; fn contains_key_wait( &mut self, promise: &Self::ContainsKey, ) -> Result<bool, ExecutionError>; fn contains_keys_new( &mut self, keys: Vec<Vec<u8>>, ) -> Result<Self::ContainsKeys, ExecutionError>; fn contains_keys_wait( &mut self, promise: &Self::ContainsKeys, ) -> Result<Vec<bool>, ExecutionError>; fn read_multi_values_bytes_new( &mut self, keys: Vec<Vec<u8>>, ) -> Result<Self::ReadMultiValuesBytes, ExecutionError>; fn read_multi_values_bytes_wait( &mut self, promise: &Self::ReadMultiValuesBytes, ) -> Result<Vec<Option<Vec<u8>>>, ExecutionError>; fn read_value_bytes_new( &mut self, key: Vec<u8>, ) -> Result<Self::ReadValueBytes, ExecutionError>; fn read_value_bytes_wait( &mut self, promise: &Self::ReadValueBytes, ) -> Result<Option<Vec<u8>>, ExecutionError>; fn find_keys_by_prefix_new( &mut self, key_prefix: Vec<u8>, ) -> Result<Self::FindKeysByPrefix, ExecutionError>; fn find_keys_by_prefix_wait( &mut self, promise: &Self::FindKeysByPrefix, ) -> Result<Vec<Vec<u8>>, ExecutionError>; fn find_key_values_by_prefix_new( &mut self, key_prefix: Vec<u8>, ) -> Result<Self::FindKeyValuesByPrefix, ExecutionError>; fn find_key_values_by_prefix_wait( &mut self, promise: &Self::FindKeyValuesByPrefix, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError>; fn perform_http_request( &mut self, request: Request, ) -> Result<Response, ExecutionError>; fn assert_before( &mut self, timestamp: Timestamp, ) -> Result<(), ExecutionError>; fn read_data_blob( &mut self, hash: &CryptoHash, ) -> Result<Vec<u8>, ExecutionError>; fn assert_data_blob_exists( &mut self, hash: &CryptoHash, ) -> Result<(), ExecutionError>; // Provided methods fn contains_key(&mut self, key: Vec<u8>) -> Result<bool, ExecutionError> { ... } fn contains_keys( &mut self, keys: Vec<Vec<u8>>, ) -> Result<Vec<bool>, ExecutionError> { ... } fn read_multi_values_bytes( &mut self, keys: Vec<Vec<u8>>, ) -> Result<Vec<Option<Vec<u8>>>, ExecutionError> { ... } fn read_value_bytes( &mut self, key: Vec<u8>, ) -> Result<Option<Vec<u8>>, ExecutionError> { ... } fn find_key_values_by_prefix( &mut self, key_prefix: Vec<u8>, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError> { ... }
}

Required Associated Types§

Required Methods§

source

fn chain_id(&mut self) -> Result<ChainId, ExecutionError>

The current chain ID.

source

fn block_height(&mut self) -> Result<BlockHeight, ExecutionError>

The current block height.

source

fn application_id(&mut self) -> Result<UserApplicationId, ExecutionError>

The current application ID.

source

fn application_creator_chain_id(&mut self) -> Result<ChainId, ExecutionError>

The current application creator’s chain ID.

source

fn application_parameters(&mut self) -> Result<Vec<u8>, ExecutionError>

The current application parameters.

source

fn read_system_timestamp(&mut self) -> Result<Timestamp, ExecutionError>

Reads the system timestamp.

source

fn read_chain_balance(&mut self) -> Result<Amount, ExecutionError>

Reads the balance of the chain.

source

fn read_owner_balance( &mut self, owner: AccountOwner, ) -> Result<Amount, ExecutionError>

Reads the owner balance.

source

fn read_owner_balances( &mut self, ) -> Result<Vec<(AccountOwner, Amount)>, ExecutionError>

Reads the balances from all owners.

source

fn read_balance_owners(&mut self) -> Result<Vec<AccountOwner>, ExecutionError>

Reads balance owners.

source

fn chain_ownership(&mut self) -> Result<ChainOwnership, ExecutionError>

Reads the current ownership configuration for this chain.

source

fn contains_key_new( &mut self, key: Vec<u8>, ) -> Result<Self::ContainsKey, ExecutionError>

Creates the promise to test whether a key exists in the key-value store

source

fn contains_key_wait( &mut self, promise: &Self::ContainsKey, ) -> Result<bool, ExecutionError>

Resolves the promise to test whether a key exists in the key-value store

source

fn contains_keys_new( &mut self, keys: Vec<Vec<u8>>, ) -> Result<Self::ContainsKeys, ExecutionError>

Creates the promise to test whether multiple keys exist in the key-value store

source

fn contains_keys_wait( &mut self, promise: &Self::ContainsKeys, ) -> Result<Vec<bool>, ExecutionError>

Resolves the promise to test whether multiple keys exist in the key-value store

source

fn read_multi_values_bytes_new( &mut self, keys: Vec<Vec<u8>>, ) -> Result<Self::ReadMultiValuesBytes, ExecutionError>

Creates the promise to access several keys from the key-value store

source

fn read_multi_values_bytes_wait( &mut self, promise: &Self::ReadMultiValuesBytes, ) -> Result<Vec<Option<Vec<u8>>>, ExecutionError>

Resolves the promise to access several keys from the key-value store

source

fn read_value_bytes_new( &mut self, key: Vec<u8>, ) -> Result<Self::ReadValueBytes, ExecutionError>

Creates the promise to access a key from the key-value store

source

fn read_value_bytes_wait( &mut self, promise: &Self::ReadValueBytes, ) -> Result<Option<Vec<u8>>, ExecutionError>

Resolves the promise to access a key from the key-value store

source

fn find_keys_by_prefix_new( &mut self, key_prefix: Vec<u8>, ) -> Result<Self::FindKeysByPrefix, ExecutionError>

Creates the promise to access keys having a specific prefix

source

fn find_keys_by_prefix_wait( &mut self, promise: &Self::FindKeysByPrefix, ) -> Result<Vec<Vec<u8>>, ExecutionError>

Resolves the promise to access keys having a specific prefix

source

fn find_key_values_by_prefix_new( &mut self, key_prefix: Vec<u8>, ) -> Result<Self::FindKeyValuesByPrefix, ExecutionError>

Creates the promise to access key/values having a specific prefix

source

fn find_key_values_by_prefix_wait( &mut self, promise: &Self::FindKeyValuesByPrefix, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError>

Resolves the promise to access key/values having a specific prefix

source

fn perform_http_request( &mut self, request: Request, ) -> Result<Response, ExecutionError>

Makes an HTTP request to the given URL and returns the answer, if any.

source

fn assert_before(&mut self, timestamp: Timestamp) -> Result<(), ExecutionError>

Ensures that the current time at block validation is < timestamp. Note that block validation happens at or after the block timestamp, but isn’t necessarily the same.

Cannot be used in fast blocks: A block using this call should be proposed by a regular owner, not a super owner.

source

fn read_data_blob( &mut self, hash: &CryptoHash, ) -> Result<Vec<u8>, ExecutionError>

Reads a data blob specified by a given hash.

source

fn assert_data_blob_exists( &mut self, hash: &CryptoHash, ) -> Result<(), ExecutionError>

Asserts the existence of a data blob with the given hash.

Provided Methods§

source

fn contains_key(&mut self, key: Vec<u8>) -> Result<bool, ExecutionError>

Tests whether a key exists in the key-value store

source

fn contains_keys( &mut self, keys: Vec<Vec<u8>>, ) -> Result<Vec<bool>, ExecutionError>

Tests whether multiple keys exist in the key-value store

source

fn read_multi_values_bytes( &mut self, keys: Vec<Vec<u8>>, ) -> Result<Vec<Option<Vec<u8>>>, ExecutionError>

Reads several keys from the key-value store

source

fn read_value_bytes( &mut self, key: Vec<u8>, ) -> Result<Option<Vec<u8>>, ExecutionError>

Reads the key from the key-value store

source

fn find_key_values_by_prefix( &mut self, key_prefix: Vec<u8>, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError>

Reads the data from the key/values having a specific prefix.

Implementors§