Trait parity_machine::WithBalances [−][src]
pub trait WithBalances: Machine { fn balance(
&self,
live: &Self::LiveBlock,
address: &Address
) -> Result<U256, Self::Error>; fn add_balance(
&self,
live: &mut Self::LiveBlock,
address: &Address,
amount: &U256
) -> Result<(), Self::Error>; }
A state machine that uses balances.
Required Methods
fn balance(
&self,
live: &Self::LiveBlock,
address: &Address
) -> Result<U256, Self::Error>
&self,
live: &Self::LiveBlock,
address: &Address
) -> Result<U256, Self::Error>
Get the balance, in base units, associated with an account. Extracts data from the live block.
fn add_balance(
&self,
live: &mut Self::LiveBlock,
address: &Address,
amount: &U256
) -> Result<(), Self::Error>
&self,
live: &mut Self::LiveBlock,
address: &Address,
amount: &U256
) -> Result<(), Self::Error>
Increment the balance of an account in the state of the live block.