Struct era_test_node::deps::InMemoryStorage
source · pub struct InMemoryStorage { /* private fields */ }
Expand description
In-memory storage.
Implementations§
source§impl InMemoryStorage
impl InMemoryStorage
sourcepub fn with_system_contracts_and_chain_id(
chain_id: L2ChainId,
bytecode_hasher: impl Fn(&[u8]) -> H256,
system_contracts_options: &Options
) -> Self
pub fn with_system_contracts_and_chain_id( chain_id: L2ChainId, bytecode_hasher: impl Fn(&[u8]) -> H256, system_contracts_options: &Options ) -> Self
Constructs a storage that contains system smart contracts (with a given chain id).
sourcepub fn set_value(&mut self, key: StorageKey, value: StorageValue)
pub fn set_value(&mut self, key: StorageKey, value: StorageValue)
Sets the storage value
at the specified key
.
sourcepub fn store_factory_dep(&mut self, hash: H256, bytecode: Vec<u8>)
pub fn store_factory_dep(&mut self, hash: H256, bytecode: Vec<u8>)
Stores a factory dependency with the specified hash
and bytecode
.
Trait Implementations§
source§impl Clone for InMemoryStorage
impl Clone for InMemoryStorage
source§fn clone(&self) -> InMemoryStorage
fn clone(&self) -> InMemoryStorage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for InMemoryStorage
impl Debug for InMemoryStorage
source§impl Default for InMemoryStorage
impl Default for InMemoryStorage
source§fn default() -> InMemoryStorage
fn default() -> InMemoryStorage
Returns the “default value” for a type. Read more
source§impl PartialEq<InMemoryStorage> for InMemoryStorage
impl PartialEq<InMemoryStorage> for InMemoryStorage
source§fn eq(&self, other: &InMemoryStorage) -> bool
fn eq(&self, other: &InMemoryStorage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ReadStorage for &InMemoryStorage
impl ReadStorage for &InMemoryStorage
source§fn read_value(&mut self, key: &StorageKey) -> StorageValue
fn read_value(&mut self, key: &StorageKey) -> StorageValue
Read value of the key.
source§fn is_write_initial(&mut self, key: &StorageKey) -> bool
fn is_write_initial(&mut self, key: &StorageKey) -> bool
Checks whether a write to this storage at the specified
key
would be an initial write.
Roughly speaking, this is the case when the storage doesn’t contain key
, although
in case of mutable storages, the caveats apply (a write to a key that is present
in the storage but was not committed is still an initial write).source§fn load_factory_dep(&mut self, hash: H256) -> Option<Vec<u8>>
fn load_factory_dep(&mut self, hash: H256) -> Option<Vec<u8>>
Load the factory dependency code by its hash.
source§fn is_bytecode_known(&mut self, bytecode_hash: &H256) -> bool
fn is_bytecode_known(&mut self, bytecode_hash: &H256) -> bool
Returns whether a bytecode hash is “known” to the system.
source§impl ReadStorage for InMemoryStorage
impl ReadStorage for InMemoryStorage
source§fn read_value(&mut self, key: &StorageKey) -> StorageValue
fn read_value(&mut self, key: &StorageKey) -> StorageValue
Read value of the key.
source§fn is_write_initial(&mut self, key: &StorageKey) -> bool
fn is_write_initial(&mut self, key: &StorageKey) -> bool
Checks whether a write to this storage at the specified
key
would be an initial write.
Roughly speaking, this is the case when the storage doesn’t contain key
, although
in case of mutable storages, the caveats apply (a write to a key that is present
in the storage but was not committed is still an initial write).source§fn load_factory_dep(&mut self, hash: H256) -> Option<Vec<u8>>
fn load_factory_dep(&mut self, hash: H256) -> Option<Vec<u8>>
Load the factory dependency code by its hash.
source§fn is_bytecode_known(&mut self, bytecode_hash: &H256) -> bool
fn is_bytecode_known(&mut self, bytecode_hash: &H256) -> bool
Returns whether a bytecode hash is “known” to the system.
impl StructuralPartialEq for InMemoryStorage
Auto Trait Implementations§
impl RefUnwindSafe for InMemoryStorage
impl Send for InMemoryStorage
impl Sync for InMemoryStorage
impl Unpin for InMemoryStorage
impl UnwindSafe for InMemoryStorage
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