pub struct TransitionAccount<S = StorageWithOriginalValues> {
pub info: Option<AccountInfo>,
pub status: AccountStatus,
pub previous_info: Option<AccountInfo>,
pub previous_status: AccountStatus,
pub storage: S,
pub storage_was_destroyed: bool,
}Expand description
Account Created when EVM state is merged to cache state. And it is sent to Block state.
It is used when block state gets merged to bundle state to create needed Reverts.
Fields§
§info: Option<AccountInfo>Account information, if account exists.
status: AccountStatusCurrent account status.
previous_info: Option<AccountInfo>Previous account info is needed for account that got initially loaded. Initially loaded account are not present inside bundle and are needed to generate Reverts.
previous_status: AccountStatusMostly needed when previous status Loaded/LoadedEmpty.
storage: SStorage contains both old and new account
storage_was_destroyed: boolIf there is transition that clears the storage we should mark it here and
delete all storages in BundleState. This flag is needed if we have transition
between Destroyed states from DestroyedChanged-> DestroyedAgain-> DestroyedChanged
in the end transition that we would have would be DestroyedChanged->DestroyedChanged
and with only that info we couldn’t decide what to do.
Implementations§
Source§impl TransitionAccount
impl TransitionAccount
Sourcepub fn new_empty_eip161(storage: StorageWithOriginalValues) -> Self
pub fn new_empty_eip161(storage: StorageWithOriginalValues) -> Self
Create new LoadedEmpty account.
Sourcepub fn has_new_contract(&self) -> Option<(B256, &Bytecode)>
pub fn has_new_contract(&self) -> Option<(B256, &Bytecode)>
Return new contract bytecode if it is changed or newly created.
Sourcepub fn previous_balance(&self) -> U256
pub fn previous_balance(&self) -> U256
Return the balance of account before transition.
Sourcepub fn current_balance(&self) -> U256
pub fn current_balance(&self) -> U256
Return the balance of account after transition.
Sourcepub fn create_revert(self) -> Option<AccountRevert>
pub fn create_revert(self) -> Option<AccountRevert>
Consume Self and create account revert from it.
Sourcepub fn present_bundle_account(&self) -> BundleAccount
pub fn present_bundle_account(&self) -> BundleAccount
Present bundle account
Source§impl<S> TransitionAccount<S>
impl<S> TransitionAccount<S>
Sourcepub fn map_storage<F, N>(self, f: F) -> TransitionAccount<N>where
F: FnOnce(S) -> N,
pub fn map_storage<F, N>(self, f: F) -> TransitionAccount<N>where
F: FnOnce(S) -> N,
Map the storage of the transition account.
Trait Implementations§
Source§impl<S: Clone> Clone for TransitionAccount<S>
impl<S: Clone> Clone for TransitionAccount<S>
Source§impl<S: Debug> Debug for TransitionAccount<S>
impl<S: Debug> Debug for TransitionAccount<S>
Source§impl<S: Default> Default for TransitionAccount<S>
impl<S: Default> Default for TransitionAccount<S>
impl<S: Eq> Eq for TransitionAccount<S>
Source§impl<S: PartialEq> PartialEq for TransitionAccount<S>
impl<S: PartialEq> PartialEq for TransitionAccount<S>
impl<S: PartialEq> StructuralPartialEq for TransitionAccount<S>
Auto Trait Implementations§
impl<S> Freeze for TransitionAccount<S>where
S: Freeze,
impl<S> RefUnwindSafe for TransitionAccount<S>where
S: RefUnwindSafe,
impl<S> Send for TransitionAccount<S>where
S: Send,
impl<S> Sync for TransitionAccount<S>where
S: Sync,
impl<S> Unpin for TransitionAccount<S>where
S: Unpin,
impl<S> UnsafeUnpin for TransitionAccount<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for TransitionAccount<S>where
S: UnwindSafe,
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> 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> 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: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.