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§

source

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

Read value of the key.

source

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>>

Load the factory dependency code by its hash.

Provided Methods§

source

fn is_bytecode_known(&mut self, bytecode_hash: &H256) -> bool

Returns whether a bytecode hash is “known” to the system.

Implementors§