Skip to main content

WorldDiff

Struct WorldDiff 

Source
pub struct WorldDiff { /* private fields */ }
Expand description

Pending modifications to the global state that are executed at the end of a block. In other words, side effects.

Implementations§

Source§

impl WorldDiff

Source

pub fn storage_refunds(&self) -> &[u32]

Returns recorded refunds for all storage operations.

Source

pub fn pubdata_costs(&self) -> &[i32]

Returns recorded pubdata costs for all storage operations.

Source

pub fn storage_log_queries(&self) -> &[LogQuery]

Returns all recorded storage log queries.

These logs are sufficient for vm2 state-transition checks and diagnostics.

Source

pub fn storage_log_queries_after(&self, snapshot: &Snapshot) -> &[LogQuery]

Returns storage log queries recorded after the specified snapshot was created.

Source

pub fn get_storage_changes( &self, ) -> impl Iterator<Item = ((H160, U256), StorageChange)> + '_

Gets changes for all touched storage slots.

Source

pub fn get_storage_changes_after( &self, snapshot: &Snapshot, ) -> impl Iterator<Item = ((H160, U256), StorageChange)> + '_

Gets changes for storage slots touched after the specified snapshot was created.

Source

pub fn events_after(&self, snapshot: &Snapshot) -> &[Event]

Returns events emitted after the specified snapshot was created.

Source

pub fn l2_to_l1_logs_after(&self, snapshot: &Snapshot) -> &[L2ToL1Log]

Returns L2-to-L1 logs emitted after the specified snapshot was created.

Source

pub fn decommitted_hashes(&self) -> impl Iterator<Item = U256> + '_

Returns hashes of contract bytecodes that were observed by decommit bookkeeping in no particular order.

This includes successful decommits and far-call out-of-gas attempts recorded as [DecommitState::Unsuccessful] for legacy used_contract_hashes compatibility.

Source

pub fn snapshot(&self) -> Snapshot

Get a snapshot for selecting which logs & co. to output using Self::events_after() and other methods.

Trait Implementations§

Source§

impl Debug for WorldDiff

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WorldDiff

Source§

fn default() -> WorldDiff

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V