pub trait Machine: Send + Sync {
type EngineClient: ?Sized;
type Error;
fn balance(
&self,
live: &ExecutedBlock,
address: &Address
) -> Result<U256, Self::Error>;
fn add_balance(
&self,
live: &mut ExecutedBlock,
address: &Address,
amount: &U256
) -> Result<(), Self::Error>;
}
Expand description
Generalization of types surrounding blockchain-suitable state machines.
Associated Types
type EngineClient: ?Sized
type EngineClient: ?Sized
A handle to a blockchain client for this machine.
Required methods
Get the balance, in base units, associated with an account. Extracts data from the live block.
fn add_balance(
&self,
live: &mut ExecutedBlock,
address: &Address,
amount: &U256
) -> Result<(), Self::Error>
fn add_balance(
&self,
live: &mut ExecutedBlock,
address: &Address,
amount: &U256
) -> Result<(), Self::Error>
Increment the balance of an account in the state of the live block.