Trait fil_actors_shared::v13::vm_api::VM

source ·
pub trait VM {
Show 20 methods // Required methods fn blockstore(&self) -> &dyn Blockstore; fn actor(&self, address: &Address) -> Option<ActorState>; fn set_actor(&self, key: &Address, a: ActorState); fn balance(&self, address: &Address) -> TokenAmount; fn resolve_id_address(&self, address: &Address) -> Option<Address>; fn execute_message( &self, from: &Address, to: &Address, value: &TokenAmount, method: MethodNum, params: Option<IpldBlock>, ) -> Result<MessageResult, VMError>; fn execute_message_implicit( &self, from: &Address, to: &Address, value: &TokenAmount, method: MethodNum, params: Option<IpldBlock>, ) -> Result<MessageResult, VMError>; fn take_invocations(&self) -> Vec<InvocationTrace>; fn primitives(&self) -> &dyn Primitives; fn mut_primitives(&self) -> &dyn MockPrimitives; fn actor_manifest(&self) -> BTreeMap<Cid, Type>; fn actor_states(&self) -> BTreeMap<Address, ActorState>; fn epoch(&self) -> ChainEpoch; fn set_epoch(&self, epoch: ChainEpoch); fn circulating_supply(&self) -> TokenAmount; fn set_circulating_supply(&self, supply: TokenAmount); fn base_fee(&self) -> TokenAmount; fn set_base_fee(&self, amount: TokenAmount); fn timestamp(&self) -> u64; fn set_timestamp(&self, timestamp: u64);
}
Expand description

An abstract VM that is injected into integration tests

Required Methods§

source

fn blockstore(&self) -> &dyn Blockstore

Returns the underlying blockstore of the VM

source

fn actor(&self, address: &Address) -> Option<ActorState>

Get information about an actor

source

fn set_actor(&self, key: &Address, a: ActorState)

Upsert an actor into the state tree

source

fn balance(&self, address: &Address) -> TokenAmount

Get the balance of the specified actor

source

fn resolve_id_address(&self, address: &Address) -> Option<Address>

Get the ID for the specified address

source

fn execute_message( &self, from: &Address, to: &Address, value: &TokenAmount, method: MethodNum, params: Option<IpldBlock>, ) -> Result<MessageResult, VMError>

Send a message between the two specified actors

source

fn execute_message_implicit( &self, from: &Address, to: &Address, value: &TokenAmount, method: MethodNum, params: Option<IpldBlock>, ) -> Result<MessageResult, VMError>

Send a message without charging gas

source

fn take_invocations(&self) -> Vec<InvocationTrace>

Take all the invocations that have been made since the last call to this method

source

fn primitives(&self) -> &dyn Primitives

Provides access to VM primitives

source

fn mut_primitives(&self) -> &dyn MockPrimitives

Provides access to VM primitives that can be mocked

source

fn actor_manifest(&self) -> BTreeMap<Cid, Type>

Return a map of actor code CIDs to their corresponding types

source

fn actor_states(&self) -> BTreeMap<Address, ActorState>

Returns a map of all actor addresses to their corresponding states

source

fn epoch(&self) -> ChainEpoch

Get the current chain epoch

source

fn set_epoch(&self, epoch: ChainEpoch)

Sets the epoch to the specified value

source

fn circulating_supply(&self) -> TokenAmount

Get the circulating supply constant for the network

source

fn set_circulating_supply(&self, supply: TokenAmount)

Set the circulating supply constant for the network

source

fn base_fee(&self) -> TokenAmount

Get the current base fee

source

fn set_base_fee(&self, amount: TokenAmount)

Set the current base fee

source

fn timestamp(&self) -> u64

Get the current timestamp

source

fn set_timestamp(&self, timestamp: u64)

Set the current timestamp

Implementors§