Struct era_test_node::node::InMemoryNodeInner  
source · pub struct InMemoryNodeInner<S> {Show 20 fields
    pub current_timestamp: u64,
    pub current_batch: u32,
    pub current_miniblock: u64,
    pub current_miniblock_hash: H256,
    pub l1_gas_price: u64,
    pub tx_results: HashMap<H256, TransactionResult>,
    pub blocks: HashMap<H256, Block<TransactionVariant>>,
    pub block_hashes: HashMap<u64, H256>,
    pub filters: EthFilters,
    pub fork_storage: ForkStorage<S>,
    pub show_calls: ShowCalls,
    pub show_storage_logs: ShowStorageLogs,
    pub show_vm_details: ShowVMDetails,
    pub show_gas_details: ShowGasDetails,
    pub resolve_hashes: bool,
    pub console_log_handler: ConsoleLogHandler,
    pub system_contracts: SystemContracts,
    pub impersonated_accounts: HashSet<Address>,
    pub rich_accounts: HashSet<H160>,
    pub previous_states: IndexMap<H256, HashMap<StorageKey, StorageValue>>,
}Expand description
Helper struct for InMemoryNode. S - is the Source of the Fork.
Fields§
§current_timestamp: u64The latest timestamp that was already generated. Next block will be current_timestamp + 1
current_batch: u32The latest batch number that was already generated. Next block will be current_batch + 1
current_miniblock: u64The latest miniblock number that was already generated. Next transaction will go to the block current_miniblock + 1
current_miniblock_hash: H256The latest miniblock hash.
l1_gas_price: u64§tx_results: HashMap<H256, TransactionResult>§blocks: HashMap<H256, Block<TransactionVariant>>§block_hashes: HashMap<u64, H256>§filters: EthFilters§fork_storage: ForkStorage<S>§show_calls: ShowCalls§show_storage_logs: ShowStorageLogs§show_vm_details: ShowVMDetails§show_gas_details: ShowGasDetails§resolve_hashes: bool§console_log_handler: ConsoleLogHandler§system_contracts: SystemContracts§impersonated_accounts: HashSet<Address>§rich_accounts: HashSet<H160>§previous_states: IndexMap<H256, HashMap<StorageKey, StorageValue>>Keeps track of historical states indexed via block hash. Limited to MAX_PREVIOUS_STATES.
Implementations§
source§impl<S: Debug + ForkSource> InMemoryNodeInner<S>
 
impl<S: Debug + ForkSource> InMemoryNodeInner<S>
pub fn create_l1_batch_env<ST: ReadStorage>( &self, storage: StoragePtr<ST> ) -> (L1BatchEnv, BlockContext)
pub fn create_system_env( &self, base_system_contracts: BaseSystemContracts, execution_mode: TxExecutionMode ) -> SystemEnv
sourcepub fn estimate_gas_impl(&self, req: CallRequest) -> Result<Fee>
 
pub fn estimate_gas_impl(&self, req: CallRequest) -> Result<Fee>
sourcepub fn set_impersonated_account(&mut self, address: Address) -> bool
 
pub fn set_impersonated_account(&mut self, address: Address) -> bool
Sets the impersonated_account field of the node.
This field is used to override the tx.initiator_account field of the transaction in the run_l2_tx method.
sourcepub fn stop_impersonating_account(&mut self, address: Address) -> bool
 
pub fn stop_impersonating_account(&mut self, address: Address) -> bool
Clears the impersonated_account field of the node.
sourcepub fn archive_state(&mut self) -> Result<(), String>
 
pub fn archive_state(&mut self) -> Result<(), String>
Archives the current state for later queries.
Trait Implementations§
source§impl<S: Clone> Clone for InMemoryNodeInner<S>
 
impl<S: Clone> Clone for InMemoryNodeInner<S>
source§fn clone(&self) -> InMemoryNodeInner<S>
 
fn clone(&self) -> InMemoryNodeInner<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 moreAuto Trait Implementations§
impl<S> RefUnwindSafe for InMemoryNodeInner<S>
impl<S> Send for InMemoryNodeInner<S>where S: Send + Sync,
impl<S> Sync for InMemoryNodeInner<S>where S: Send + Sync,
impl<S> Unpin for InMemoryNodeInner<S>
impl<S> UnwindSafe for InMemoryNodeInner<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