pub trait WriteStorage: ReadStorage {
    // Required methods
    fn set_value(
        &mut self,
        key: StorageKey,
        value: StorageValue
    ) -> StorageValue;
    fn modified_storage_keys(&self) -> &HashMap<StorageKey, StorageValue>;
    fn missed_storage_invocations(&self) -> usize;
}
Expand description

Functionality to write to the VM storage in a batch.

So far, this trait is implemented only for [zksync_state::StorageView].

Required Methods§

source

fn set_value(&mut self, key: StorageKey, value: StorageValue) -> StorageValue

Sets the new value under a given key and returns the previous value.

source

fn modified_storage_keys(&self) -> &HashMap<StorageKey, StorageValue>

Returns a map with the key–value pairs updated by this batch.

source

fn missed_storage_invocations(&self) -> usize

Returns the number of read / write ops for which the value was read from the underlying storage.

Implementors§