Struct sputnikvm::AccountState

source ·
pub struct AccountState<A: AccountPatch> { /* private fields */ }
Expand description

A struct that manages the current account state for one EVM.

Implementations

Returns all fetched or modified addresses.

Returns all accounts right now in this account state.

Returns Ok(()) if a full account is in this account state. Otherwise raise a RequireError.

Returns Ok(()) if either a full account or a partial code account is in this account state. Otherwise raise a RequireError.

Returns Ok(()) if the storage exists in the VM. Otherwise raise a RequireError.

Commit an account commitment into this account state.

Test whether an account at given address is considered existing.

Find code by its address in this account state. If the search failed, returns a RequireError.

Find code of account that may not exist. If search failed, returns a RequireError

Find nonce by its address in this account state. If the search failed, returns a RequireError.

Find balance by its address in this account state. If the search failed, returns a RequireError.

Read a value from an account storage.

Read an original (pre-execution) value from an account storage

Write a value from an account storage. The account will be created if it is nonexist.

Create a new account (that should not yet have existed before).

Deposit code in to a created account. Only usable in a newly created account.

Increase the balance of an account. The account will be created if it is nonexist in the beginning.

Decrease the balance of an account. The account will be created if it is nonexist in the beginning.

Set nonce of an account. If the account is not already commited, returns a RequireError. The account will be created if it is nonexist in the beginning.

Delete an account from this account state. The account is set to null.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.