Struct ethcore::state::Account[][src]

pub struct Account { /* fields omitted */ }

Single account in the system. Keeps track of changes to the code and storage. The changes are applied in commit_storage and commit_code

Methods

impl Account
[src]

General constructor.

Create a new account with the given balance.

Create a new account from RLP.

Create a new contract account. NOTE: make sure you use init_code on this before commiting.

Set this account's code to the given code. NOTE: Account should have been created with new_contract()

Reset this account's code to the given code.

Reset this account's code and storage to given values.

Set (and cache) the contents of the trie's storage at key to value.

Get (and cache) the contents of the trie's storage at key. Takes modified storage into account.

Get cached storage value if any. Returns None if the key is not in the cache.

return the balance associated with this account.

return the nonce associated with this account.

return the code hash associated with this account.

return the code hash associated with this account.

returns the account's code. If None then the code cache isn't available - get someone who knows to call note_code.

returns the account's code size. If None then the code cache or code size cache isn't available - get someone who knows to call note_code.

Is code_cache valid; such that code is going to return Some?

Provide a database to get code_hash. Should not be called if it is a contract without code.

Provide code to cache. For correctness, should be the correct code for the account.

Provide a database to get code_size. Should not be called if it is a contract without code.

Determine whether there are any un-commit()-ed storage-setting operations.

Check if account has zero nonce, balance, no code and no storage.

NOTE: Will panic if !self.storage_is_clean()

Check if account has zero nonce, balance, no code.

Check if account is basic (Has no code).

Return the storage root associated with this account or None if it has been altered via the overlay.

Return the storage overlay.

Increment the nonce of the account by one.

Increase account balance.

Decrease account balance. Panics if balance is less than x

Commit the storage_changes to the backing DB and update storage_root.

Commit any unsaved code. code_hash will always return the hash of the code_cache after this.

Export to RLP.

Clone basic account data

Clone account data and dirty storage keys

Clone account data, dirty storage keys and cached storage keys.

Replace self with the data from other account merging storage cache. Basic account data and all modifications are overwritten with new values.

impl Account
[src]

Prove a storage key's existence or nonexistence in the account's storage trie. storage_key is the hash of the desired storage key, meaning this will only work correctly under a secure trie.

Trait Implementations

impl From<BasicAccount> for Account
[src]

Performs the conversion.

impl Debug for Account
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Account

impl !Sync for Account