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
impl WorldDiff
Sourcepub fn storage_refunds(&self) -> &[u32]
pub fn storage_refunds(&self) -> &[u32]
Returns recorded refunds for all storage operations.
Sourcepub fn pubdata_costs(&self) -> &[i32]
pub fn pubdata_costs(&self) -> &[i32]
Returns recorded pubdata costs for all storage operations.
Sourcepub fn storage_log_queries(&self) -> &[LogQuery]
pub fn storage_log_queries(&self) -> &[LogQuery]
Returns all recorded storage log queries.
These logs are sufficient for vm2 state-transition checks and diagnostics.
Sourcepub fn storage_log_queries_after(&self, snapshot: &Snapshot) -> &[LogQuery]
pub fn storage_log_queries_after(&self, snapshot: &Snapshot) -> &[LogQuery]
Returns storage log queries recorded after the specified snapshot was created.
Sourcepub fn get_storage_changes(
&self,
) -> impl Iterator<Item = ((H160, U256), StorageChange)> + '_
pub fn get_storage_changes( &self, ) -> impl Iterator<Item = ((H160, U256), StorageChange)> + '_
Gets changes for all touched storage slots.
Sourcepub fn get_storage_changes_after(
&self,
snapshot: &Snapshot,
) -> impl Iterator<Item = ((H160, U256), StorageChange)> + '_
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.
Sourcepub fn events_after(&self, snapshot: &Snapshot) -> &[Event]
pub fn events_after(&self, snapshot: &Snapshot) -> &[Event]
Returns events emitted after the specified snapshot was created.
Sourcepub fn l2_to_l1_logs_after(&self, snapshot: &Snapshot) -> &[L2ToL1Log]
pub fn l2_to_l1_logs_after(&self, snapshot: &Snapshot) -> &[L2ToL1Log]
Returns L2-to-L1 logs emitted after the specified snapshot was created.
Sourcepub fn decommitted_hashes(&self) -> impl Iterator<Item = U256> + '_
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.
Sourcepub fn snapshot(&self) -> Snapshot
pub fn snapshot(&self) -> Snapshot
Get a snapshot for selecting which logs & co. to output using Self::events_after() and other methods.