Struct sputnikvm::AccountState
[−]
[src]
pub struct AccountState<A: AccountPatch> { /* fields omitted */ }
A struct that manages the current account state for one EVM.
Methods
impl<A: AccountPatch> AccountState<A>
[src]
fn used_addresses(&self) -> Set<Address>
[src]
Returns all fetched or modified addresses.
fn accounts(&self) -> Values<Address, AccountChange>
[src]
Returns all accounts right now in this account state.
fn require(&self, address: Address) -> Result<(), RequireError>
[src]
Returns Ok(()) if a full account is in this account
state. Otherwise raise a RequireError
.
fn require_code(&self, address: Address) -> Result<(), RequireError>
[src]
Returns Ok(()) if either a full account or a partial code
account is in this account state. Otherwise raise a
RequireError
.
fn require_storage(
&self,
address: Address,
index: U256
) -> Result<(), RequireError>
[src]
&self,
address: Address,
index: U256
) -> Result<(), RequireError>
Returns Ok(()) if the storage exists in the VM. Otherwise
raise a RequireError
.
fn commit(&mut self, commitment: AccountCommitment) -> Result<(), CommitError>
[src]
Commit an account commitment into this account state.
fn exists(&self, address: Address) -> Result<bool, RequireError>
[src]
Test whether an account at given address is considered existing.
fn premark_exists(&mut self, address: Address)
[src]
Premark an address as exist.
fn code(&self, address: Address) -> Result<Rc<Vec<u8>>, RequireError>
[src]
Find code by its address in this account state. If the search
failed, returns a RequireError
.
fn nonce(&self, address: Address) -> Result<U256, RequireError>
[src]
Find nonce by its address in this account state. If the search
failed, returns a RequireError
.
fn balance(&self, address: Address) -> Result<U256, RequireError>
[src]
Find balance by its address in this account state. If the
search failed, returns a RequireError
.
fn storage(&self, address: Address) -> Result<&Storage, RequireError>
[src]
Returns the storage of an account. If the account is not yet
committed, returns a RequireError
.
fn storage_mut(
&mut self,
address: Address
) -> Result<&mut Storage, RequireError>
[src]
&mut self,
address: Address
) -> Result<&mut Storage, RequireError>
Returns the mutable storage of an account. If the account is
not yet committed. returns a RequireError
.
fn create(&mut self, address: Address, topup: U256) -> Result<(), RequireError>
[src]
Create a new account (that should not yet have existed before).
fn code_deposit(&mut self, address: Address, new_code: Rc<Vec<u8>>)
[src]
Deposit code in to a created account.
fn increase_balance(&mut self, address: Address, topup: U256)
[src]
Increase the balance of an account.
fn decrease_balance(&mut self, address: Address, withdraw: U256)
[src]
Decrease the balance of an account.
fn set_nonce(
&mut self,
address: Address,
new_nonce: U256
) -> Result<(), RequireError>
[src]
&mut self,
address: Address,
new_nonce: U256
) -> Result<(), RequireError>
Set nonce of an account. If the account is not already
commited, returns a RequireError
.
fn remove(&mut self, address: Address) -> Result<(), RequireError>
[src]
Delete an account from this account state. The account is set
to null. If the account is not already commited, returns a
RequireError
.