Struct zksync_vm2::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
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 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 decommitted contract bytecodes in no particular order. Note that this includes failed (out-of-gas) decommitments.
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorldDiff
impl RefUnwindSafe for WorldDiff
impl Send for WorldDiff
impl Sync for WorldDiff
impl Unpin for WorldDiff
impl UnwindSafe for WorldDiff
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
Mutably borrows from an owned value. Read more