VM

Trait 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§