Trait era_test_node::deps::ReadStorage
source · pub trait ReadStorage: Debug {
// Required methods
fn read_value(&mut self, key: &StorageKey) -> StorageValue;
fn is_write_initial(&mut self, key: &StorageKey) -> bool;
fn load_factory_dep(&mut self, hash: H256) -> Option<Vec<u8>>;
// Provided method
fn is_bytecode_known(&mut self, bytecode_hash: &H256) -> bool { ... }
}
Expand description
Functionality to read from the VM storage.
Required Methods§
sourcefn read_value(&mut self, key: &StorageKey) -> StorageValue
fn read_value(&mut self, key: &StorageKey) -> StorageValue
Read value of the key.
sourcefn 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).
sourcefn 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.
Provided Methods§
sourcefn 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.