Struct miden_objects::accounts::AccountStub
source · pub struct AccountStub { /* private fields */ }Expand description
A stub of an account which contains information that succinctly describes the state of the components of the account.
The AccountStub is composed of:
- id: the account id (AccountId) of the account.
- nonce: the nonce of the account.
- vault_root: a commitment to the account’s vault (super::AssetVault).
- storage_root: accounts storage root (super::AccountStorage).
- code_root: a commitment to the account’s code (super::AccountCode).
Implementations§
source§impl AccountStub
impl AccountStub
sourcepub fn new(
id: AccountId,
nonce: Felt,
vault_root: Digest,
storage_root: Digest,
code_root: Digest,
) -> Self
pub fn new( id: AccountId, nonce: Felt, vault_root: Digest, storage_root: Digest, code_root: Digest, ) -> Self
Creates a new AccountStub.
sourcepub fn hash(&self) -> Digest
pub fn hash(&self) -> Digest
Returns hash of this account.
Hash of an account is computed as hash(id, nonce, vault_root, storage_root, code_root). Computing the account hash requires 2 permutations of the hash function.
sourcepub fn vault_root(&self) -> Digest
pub fn vault_root(&self) -> Digest
Returns the vault root of this account.
sourcepub fn storage_root(&self) -> Digest
pub fn storage_root(&self) -> Digest
Returns the storage root of this account.
Trait Implementations§
source§impl Clone for AccountStub
impl Clone for AccountStub
source§fn clone(&self) -> AccountStub
fn clone(&self) -> AccountStub
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for AccountStub
impl Debug for AccountStub
source§impl From<&Account> for AccountStub
impl From<&Account> for AccountStub
source§impl From<Account> for AccountStub
impl From<Account> for AccountStub
source§impl PartialEq for AccountStub
impl PartialEq for AccountStub
source§fn eq(&self, other: &AccountStub) -> bool
fn eq(&self, other: &AccountStub) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for AccountStub
impl StructuralPartialEq for AccountStub
Auto Trait Implementations§
impl Freeze for AccountStub
impl RefUnwindSafe for AccountStub
impl Send for AccountStub
impl Sync for AccountStub
impl Unpin for AccountStub
impl UnwindSafe for AccountStub
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)