Trait forest_filecoin::shim::fvm_latest::kernel::prelude::SelfOps

source ·
pub trait SelfOps: IpldBlockOps {
    // Required methods
    fn root(&mut self) -> Result<Cid<64>, ExecutionError>;
    fn set_root(&mut self, root: Cid<64>) -> Result<(), ExecutionError>;
    fn current_balance(&self) -> Result<TokenAmount, ExecutionError>;
    fn self_destruct(
        &mut self,
        burn_unspent: bool,
    ) -> Result<(), ExecutionError>;
}
Expand description

Actor state access and manipulation. Depends on BlockOps to read and write blocks in the state tree.

Required Methods§

source

fn root(&mut self) -> Result<Cid<64>, ExecutionError>

Get the state root.

source

fn set_root(&mut self, root: Cid<64>) -> Result<(), ExecutionError>

Update the state-root.

This method will fail if the new state-root isn’t reachable.

source

fn current_balance(&self) -> Result<TokenAmount, ExecutionError>

The balance of the receiver.

source

fn self_destruct(&mut self, burn_unspent: bool) -> Result<(), ExecutionError>

Deletes the executing actor from the state tree, burning any remaining balance if requested.

Implementors§