pub struct BundleAccount {
pub info: Option<AccountInfo>,
pub original_info: Option<AccountInfo>,
pub storage: StorageWithOriginalValues,
pub status: AccountStatus,
}Expand description
Account information focused on creating of database changesets and Reverts.
Status is needed as to know from what state we are applying the TransitionAccount.
Original account info is needed to know if there was a change.
Same thing for storage with original value.
On selfdestruct storage original value is ignored.
Fields§
§info: Option<AccountInfo>Current account information.
original_info: Option<AccountInfo>Original account information before modifications.
storage: StorageWithOriginalValuesContains both original and present state. When extracting changeset we compare if original value is different from present value. If it is different we add it to changeset.
If Account was destroyed we ignore original value and compare present state with U256::ZERO.
status: AccountStatusAccount status.
Implementations§
Source§impl BundleAccount
impl BundleAccount
Sourcepub const fn new(
original_info: Option<AccountInfo>,
present_info: Option<AccountInfo>,
storage: StorageWithOriginalValues,
status: AccountStatus,
) -> Self
pub const fn new( original_info: Option<AccountInfo>, present_info: Option<AccountInfo>, storage: StorageWithOriginalValues, status: AccountStatus, ) -> Self
Create new BundleAccount.
Sourcepub fn size_hint(&self) -> usize
pub fn size_hint(&self) -> usize
The approximate size of changes needed to store this account.
1 + storage_len
Sourcepub fn storage_slot(&self, slot: U256) -> Option<U256>
pub fn storage_slot(&self, slot: U256) -> Option<U256>
Return storage slot if it exists.
In case we know that account is newly created or destroyed, return
Some(U256::ZERO)
Sourcepub fn account_info(&self) -> Option<AccountInfo>
pub fn account_info(&self) -> Option<AccountInfo>
Fetch account info if it exists.
Sourcepub const fn was_destroyed(&self) -> bool
pub const fn was_destroyed(&self) -> bool
Was this account destroyed.
Sourcepub fn is_info_changed(&self) -> bool
pub fn is_info_changed(&self) -> bool
Return true of account info was changed.
Sourcepub fn is_contract_changed(&self) -> bool
pub fn is_contract_changed(&self) -> bool
Return true if contract was changed
Sourcepub fn revert(&mut self, revert: AccountRevert) -> bool
pub fn revert(&mut self, revert: AccountRevert) -> bool
Revert account to previous state and return true if account can be removed.
Sourcepub fn update_and_create_revert(
&mut self,
transition: TransitionAccount,
) -> Option<AccountRevert>
pub fn update_and_create_revert( &mut self, transition: TransitionAccount, ) -> Option<AccountRevert>
Update to new state and generate AccountRevert that if applied to new state will revert it to previous state.
If no revert is present, update is noop.
Trait Implementations§
Source§impl Clone for BundleAccount
impl Clone for BundleAccount
Source§impl Debug for BundleAccount
impl Debug for BundleAccount
Source§impl<'de> Deserialize<'de> for BundleAccount
Available on crate feature serde only.
impl<'de> Deserialize<'de> for BundleAccount
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 BundleAccount
Source§impl PartialEq for BundleAccount
impl PartialEq for BundleAccount
Source§impl Serialize for BundleAccount
Available on crate feature serde only.
impl Serialize for BundleAccount
serde only.impl StructuralPartialEq for BundleAccount
Auto Trait Implementations§
impl Freeze for BundleAccount
impl RefUnwindSafe for BundleAccount
impl Send for BundleAccount
impl Sync for BundleAccount
impl Unpin for BundleAccount
impl UnsafeUnpin for BundleAccount
impl UnwindSafe for BundleAccount
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<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: 240 bytes