Struct era_test_node::fork::ForkStorage
source · pub struct ForkStorage<S> {
pub inner: Arc<RwLock<ForkStorageInner<S>>>,
pub chain_id: L2ChainId,
}
Expand description
In memory storage, that allows ‘forking’ from other network. If forking is enabled, it reads missing data from remote location. S - is a struct that is used for source of the fork.
Fields§
§inner: Arc<RwLock<ForkStorageInner<S>>>
§chain_id: L2ChainId
Implementations§
source§impl<S: ForkSource> ForkStorage<S>
impl<S: ForkSource> ForkStorage<S>
pub fn new( fork: Option<ForkDetails>, system_contracts_options: &Options ) -> Self
pub fn get_cache_config(&self) -> Result<CacheConfig, String>
pub fn get_fork_url(&self) -> Result<String, String>
pub fn read_value_internal(&self, key: &StorageKey) -> Result<StorageValue>
pub fn load_factory_dep_internal(&self, hash: H256) -> Result<Option<Vec<u8>>>
sourcepub fn is_write_initial_internal(&self, key: &StorageKey) -> Result<bool>
pub fn is_write_initial_internal(&self, key: &StorageKey) -> Result<bool>
Check if this is the first time when we’re ever writing to this key. This has impact on amount of pubdata that we have to spend for the write.
source§impl<S> ForkStorage<S>
impl<S> ForkStorage<S>
Trait Implementations§
source§impl<S: Clone> Clone for ForkStorage<S>
impl<S: Clone> Clone for ForkStorage<S>
source§fn clone(&self) -> ForkStorage<S>
fn clone(&self) -> ForkStorage<S>
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<S: Debug> Debug for ForkStorage<S>
impl<S: Debug> Debug for ForkStorage<S>
source§impl<S: Debug + ForkSource> ReadStorage for &ForkStorage<S>
impl<S: Debug + ForkSource> ReadStorage for &ForkStorage<S>
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 storage, 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 get_enumeration_index(&mut self, key: &StorageKey) -> Option<u64>
fn get_enumeration_index(&mut self, key: &StorageKey) -> Option<u64>
Retrieves the enumeration index for a given
key
.§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<S: Debug + ForkSource> ReadStorage for ForkStorage<S>
impl<S: Debug + ForkSource> ReadStorage for ForkStorage<S>
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 storage, 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 read_value(&mut self, key: &StorageKey) -> StorageValue
fn read_value(&mut self, key: &StorageKey) -> StorageValue
Read value of the key.
source§fn get_enumeration_index(&mut self, key: &StorageKey) -> Option<u64>
fn get_enumeration_index(&mut self, key: &StorageKey) -> Option<u64>
Retrieves the enumeration index for a given
key
.§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.
Auto Trait Implementations§
impl<S> RefUnwindSafe for ForkStorage<S>
impl<S> Send for ForkStorage<S>
impl<S> Sync for ForkStorage<S>
impl<S> Unpin for ForkStorage<S>
impl<S> UnwindSafe for ForkStorage<S>
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request