Struct alloy_genesis::GenesisAccount
source · pub struct GenesisAccount {
pub nonce: Option<u64>,
pub balance: U256,
pub code: Option<Bytes>,
pub storage: Option<BTreeMap<B256, B256>>,
pub private_key: Option<B256>,
}
Expand description
An account in the state of the genesis block.
Fields§
§nonce: Option<u64>
The nonce of the account at genesis.
balance: U256
The balance of the account at genesis.
code: Option<Bytes>
The account’s bytecode at genesis.
storage: Option<BTreeMap<B256, B256>>
The account’s storage at genesis.
private_key: Option<B256>
The account’s private key. Should only be used for testing.
Implementations§
source§impl GenesisAccount
impl GenesisAccount
sourcepub const fn with_nonce(self, nonce: Option<u64>) -> Self
pub const fn with_nonce(self, nonce: Option<u64>) -> Self
Set the nonce.
sourcepub const fn with_balance(self, balance: U256) -> Self
pub const fn with_balance(self, balance: U256) -> Self
Set the balance.
sourcepub fn into_trie_account(self) -> TrieAccount
pub fn into_trie_account(self) -> TrieAccount
Convert the genesis account into the TrieAccount
format.
Trait Implementations§
source§impl Clone for GenesisAccount
impl Clone for GenesisAccount
source§fn clone(&self) -> GenesisAccount
fn clone(&self) -> GenesisAccount
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 GenesisAccount
impl Debug for GenesisAccount
source§impl Default for GenesisAccount
impl Default for GenesisAccount
source§fn default() -> GenesisAccount
fn default() -> GenesisAccount
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for GenesisAccount
impl<'de> Deserialize<'de> for GenesisAccount
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<GenesisAccount> for TrieAccount
impl From<GenesisAccount> for TrieAccount
source§fn from(account: GenesisAccount) -> Self
fn from(account: GenesisAccount) -> Self
Converts to this type from the input type.
source§impl PartialEq for GenesisAccount
impl PartialEq for GenesisAccount
source§fn eq(&self, other: &GenesisAccount) -> bool
fn eq(&self, other: &GenesisAccount) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for GenesisAccount
impl Serialize for GenesisAccount
impl Eq for GenesisAccount
impl StructuralPartialEq for GenesisAccount
Auto Trait Implementations§
impl !Freeze for GenesisAccount
impl RefUnwindSafe for GenesisAccount
impl Send for GenesisAccount
impl Sync for GenesisAccount
impl Unpin for GenesisAccount
impl UnwindSafe for GenesisAccount
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
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.