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§
Sourcefn root(&mut self) -> Result<Cid<64>, ExecutionError>
fn root(&mut self) -> Result<Cid<64>, ExecutionError>
Get the state root.
Sourcefn set_root(&mut self, root: Cid<64>) -> Result<(), ExecutionError>
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.
Sourcefn current_balance(&self) -> Result<TokenAmount, ExecutionError>
fn current_balance(&self) -> Result<TokenAmount, ExecutionError>
The balance of the receiver.
Sourcefn self_destruct(&mut self, burn_unspent: bool) -> Result<(), ExecutionError>
fn self_destruct(&mut self, burn_unspent: bool) -> Result<(), ExecutionError>
Deletes the executing actor from the state tree, burning any remaining balance if requested.