Struct AlloyAccountChanges
pub struct AlloyAccountChanges {
pub address: Address,
pub storage_changes: Vec<SlotChanges>,
pub storage_reads: Vec<Uint<256, 4>>,
pub balance_changes: Vec<BalanceChange>,
pub nonce_changes: Vec<NonceChange>,
pub code_changes: Vec<CodeChange>,
}Expand description
This struct is used to track the changes across accounts in a block.
Fields§
§address: AddressThe address of the account whoose changes are stored.
storage_changes: Vec<SlotChanges>List of slot changes for this account.
storage_reads: Vec<Uint<256, 4>>List of storage reads for this account.
balance_changes: Vec<BalanceChange>List of balance changes for this account.
nonce_changes: Vec<NonceChange>List of nonce changes for this account.
code_changes: Vec<CodeChange>List of code changes for this account.
Implementations§
§impl AccountChanges
impl AccountChanges
pub const fn new(address: Address) -> AccountChanges
pub const fn new(address: Address) -> AccountChanges
Creates a new AccountChanges instance for the given address with empty vectors.
pub fn with_capacity(address: Address, capacity: usize) -> AccountChanges
pub fn with_capacity(address: Address, capacity: usize) -> AccountChanges
Creates a new AccountChanges instance for the given address with specified capacity.
pub fn storage_changes(&self) -> &[SlotChanges]
pub fn storage_changes(&self) -> &[SlotChanges]
Returns the storage changes for this account.
pub fn storage_post_states(
&self,
) -> impl Iterator<Item = (Uint<256, 4>, Uint<256, 4>)>
pub fn storage_post_states( &self, ) -> impl Iterator<Item = (Uint<256, 4>, Uint<256, 4>)>
Returns an iterator over the post-state value for each changed storage slot.
The post-state value is taken from the last recorded change for each slot.
pub fn storage_reads(&self) -> &[Uint<256, 4>]
pub fn storage_reads(&self) -> &[Uint<256, 4>]
Returns the storage reads for this account.
pub fn balance_changes(&self) -> &[BalanceChange]
pub fn balance_changes(&self) -> &[BalanceChange]
Returns the balance changes for this account.
pub fn nonce_changes(&self) -> &[NonceChange]
pub fn nonce_changes(&self) -> &[NonceChange]
Returns the nonce changes for this account.
pub fn code_changes(&self) -> &[CodeChange]
pub fn code_changes(&self) -> &[CodeChange]
Returns the code changes for this account.
pub fn sort(&mut self)
pub fn sort(&mut self)
Sorts this account’s changes in-place according to the account-local EIP-7928 ordering rules.
This applies the account-local ordering required by the “Ordering, Uniqueness and Determinism” section of EIP-7928:
storage_changesare sorted lexicographically by storage key- each per-slot
StorageChangelist is sorted by block access index in ascending order storage_readsare sorted lexicographically by storage keybalance_changes,nonce_changes, andcode_changesare sorted by block access index in ascending order
Per-slot storage change ordering is delegated to [SlotChanges::sort].
This method only canonicalizes ordering for a single account. It does not enforce the EIP-7928 uniqueness constraints for storage keys or block access indexes.
pub const fn with_address(self, address: Address) -> AccountChanges
pub const fn with_address(self, address: Address) -> AccountChanges
Set the address.
pub fn with_storage_read(self, key: Uint<256, 4>) -> AccountChanges
pub fn with_storage_read(self, key: Uint<256, 4>) -> AccountChanges
Add a storage read slot.
pub fn with_storage_change(self, change: SlotChanges) -> AccountChanges
pub fn with_storage_change(self, change: SlotChanges) -> AccountChanges
Add a storage change (multiple writes to a slot grouped in SlotChanges).
pub fn with_balance_change(self, change: BalanceChange) -> AccountChanges
pub fn with_balance_change(self, change: BalanceChange) -> AccountChanges
Add a balance change.
pub fn with_nonce_change(self, change: NonceChange) -> AccountChanges
pub fn with_nonce_change(self, change: NonceChange) -> AccountChanges
Add a nonce change.
pub fn with_code_change(self, change: CodeChange) -> AccountChanges
pub fn with_code_change(self, change: CodeChange) -> AccountChanges
Add a code change.
pub fn extend_storage_reads<I>(self, iter: I) -> AccountChangeswhere
I: IntoIterator<Item = Uint<256, 4>>,
pub fn extend_storage_reads<I>(self, iter: I) -> AccountChangeswhere
I: IntoIterator<Item = Uint<256, 4>>,
Add multiple storage reads at once.
pub fn extend_storage_changes<I>(self, iter: I) -> AccountChangeswhere
I: IntoIterator<Item = SlotChanges>,
pub fn extend_storage_changes<I>(self, iter: I) -> AccountChangeswhere
I: IntoIterator<Item = SlotChanges>,
Add multiple slot changes at once.
Trait Implementations§
§impl Clone for AccountChanges
impl Clone for AccountChanges
§fn clone(&self) -> AccountChanges
fn clone(&self) -> AccountChanges
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for AccountChanges
impl Debug for AccountChanges
§impl Decodable for AccountChanges
impl Decodable for AccountChanges
§fn decode(b: &mut &[u8]) -> Result<AccountChanges, Error>
fn decode(b: &mut &[u8]) -> Result<AccountChanges, Error>
buf must be advanced past
the decoded object.§impl Default for AccountChanges
impl Default for AccountChanges
§fn default() -> AccountChanges
fn default() -> AccountChanges
§impl<'de> Deserialize<'de> for AccountChanges
impl<'de> Deserialize<'de> for AccountChanges
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountChanges, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountChanges, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Encodable for AccountChanges
impl Encodable for AccountChanges
impl Eq for AccountChanges
§impl FromIterator<AccountChanges> for Bal
impl FromIterator<AccountChanges> for Bal
§fn from_iter<I>(iter: I) -> Balwhere
I: IntoIterator<Item = AccountChanges>,
fn from_iter<I>(iter: I) -> Balwhere
I: IntoIterator<Item = AccountChanges>,
§impl PartialEq for AccountChanges
impl PartialEq for AccountChanges
§impl Serialize for AccountChanges
impl Serialize for AccountChanges
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for AccountChanges
Auto Trait Implementations§
impl Freeze for AccountChanges
impl RefUnwindSafe for AccountChanges
impl Send for AccountChanges
impl Sync for AccountChanges
impl Unpin for AccountChanges
impl UnsafeUnpin for AccountChanges
impl UnwindSafe for AccountChanges
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
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<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
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 more§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.