pub enum AccountStatus {
LoadedNotExisting,
Loaded,
LoadedEmptyEIP161,
InMemoryChange,
Changed,
Destroyed,
DestroyedChanged,
DestroyedAgain,
}Expand description
AccountStatus represents the various states an account can be in after being loaded from the database.
After account get loaded from database it can be in a lot of different states while we execute multiple transaction and even blocks over account that is in memory. This structure models all possible states that account can be in.
§Variants
LoadedNotExisting: the account has been loaded but does not exist.Loaded: the account has been loaded and exists.LoadedEmptyEIP161: the account is loaded and empty, as per EIP-161.InMemoryChange: there are changes in the account that exist only in memory.Changed: the account has been modified.Destroyed: the account has been destroyed.DestroyedChanged: the account has been destroyed and then modified.DestroyedAgain: the account has been destroyed again.
Variants§
LoadedNotExisting
The account has been loaded but does not exist.
Loaded
The account has been loaded and exists.
LoadedEmptyEIP161
The account is loaded and empty, as per EIP-161.
InMemoryChange
There are changes in the account that exist only in memory.
Changed
The account has been modified.
Destroyed
The account has been destroyed.
DestroyedChanged
The account has been destroyed and then modified.
DestroyedAgain
The account has been destroyed again.
Implementations§
Source§impl AccountStatus
impl AccountStatus
Sourcepub const fn is_not_modified(&self) -> bool
pub const fn is_not_modified(&self) -> bool
Account is not modified and just loaded from database.
Sourcepub const fn was_destroyed(&self) -> bool
pub const fn was_destroyed(&self) -> bool
Account was destroyed by calling SELFDESTRUCT. This means that full account and storage are inside memory.
Sourcepub const fn is_storage_known(&self) -> bool
pub const fn is_storage_known(&self) -> bool
This means storage is known, it can be newly created or storage got destroyed.
Sourcepub const fn is_modified_and_not_destroyed(&self) -> bool
pub const fn is_modified_and_not_destroyed(&self) -> bool
Account is modified but not destroyed. This means that some storage values can be found in both memory and database.
Sourcepub const fn on_created(&self) -> Self
pub const fn on_created(&self) -> Self
Returns the next account status on creation.
Sourcepub const fn on_touched_empty_post_eip161(&self) -> Self
pub const fn on_touched_empty_post_eip161(&self) -> Self
Returns the next account status on touched empty account post state clear EIP (EIP-161).
Sourcepub const fn on_changed(&self, had_no_nonce_and_code: bool) -> Self
pub const fn on_changed(&self, had_no_nonce_and_code: bool) -> Self
Returns the next account status on change.
Sourcepub const fn on_selfdestructed(&self) -> Self
pub const fn on_selfdestructed(&self) -> Self
Returns the next account status on selfdestruct.
Sourcepub fn transition(&mut self, other: Self)
pub fn transition(&mut self, other: Self)
Transition to other state while preserving invariance of this state.
It this account was Destroyed and other account is not:
- We should mark extended account as destroyed too.
- And as other account had some changes, extended account should be marked as DestroyedChanged.
If both account are not destroyed and if this account is in memory:
- This means that extended account is in memory too.
Otherwise, if both are destroyed or other is destroyed:
- Sets other status to extended account.
Trait Implementations§
Source§impl Clone for AccountStatus
impl Clone for AccountStatus
impl Copy for AccountStatus
Source§impl Debug for AccountStatus
impl Debug for AccountStatus
Source§impl Default for AccountStatus
impl Default for AccountStatus
Source§impl<'de> Deserialize<'de> for AccountStatus
Available on crate feature serde only.
impl<'de> Deserialize<'de> for AccountStatus
serde only.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>,
impl Eq for AccountStatus
Source§impl Hash for AccountStatus
impl Hash for AccountStatus
Source§impl Ord for AccountStatus
impl Ord for AccountStatus
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AccountStatus
impl PartialEq for AccountStatus
Source§impl PartialOrd for AccountStatus
impl PartialOrd for AccountStatus
Source§impl Serialize for AccountStatus
Available on crate feature serde only.
impl Serialize for AccountStatus
serde only.impl StructuralPartialEq for AccountStatus
Auto Trait Implementations§
impl Freeze for AccountStatus
impl RefUnwindSafe for AccountStatus
impl Send for AccountStatus
impl Sync for AccountStatus
impl Unpin for AccountStatus
impl UnsafeUnpin for AccountStatus
impl UnwindSafe for AccountStatus
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
LoadedNotExisting: 0 bytesLoaded: 0 bytesLoadedEmptyEIP161: 0 bytesInMemoryChange: 0 bytesChanged: 0 bytesDestroyed: 0 bytesDestroyedChanged: 0 bytesDestroyedAgain: 0 bytes