Trait era_test_node::fork::ForkSource
source · pub trait ForkSource {
// Required methods
fn get_storage_at(
&self,
address: Address,
idx: U256,
block: Option<BlockIdVariant>
) -> Result<H256>;
fn get_bytecode_by_hash(&self, hash: H256) -> Result<Option<Vec<u8>>>;
fn get_transaction_by_hash(&self, hash: H256) -> Result<Option<Transaction>>;
fn get_raw_block_transactions(
&self,
block_number: MiniblockNumber
) -> Result<Vec<Transaction>>;
fn get_block_by_hash(
&self,
hash: H256,
full_transactions: bool
) -> Result<Option<Block<TransactionVariant>>>;
fn get_block_by_number(
&self,
block_number: BlockNumber,
full_transactions: bool
) -> Result<Option<Block<TransactionVariant>>>;
fn get_block_transaction_count_by_hash(
&self,
block_hash: H256
) -> Result<Option<U256>>;
fn get_block_transaction_count_by_number(
&self,
block_number: BlockNumber
) -> Result<Option<U256>>;
fn get_transaction_by_block_hash_and_index(
&self,
block_hash: H256,
index: Index
) -> Result<Option<Transaction>>;
fn get_transaction_by_block_number_and_index(
&self,
block_number: BlockNumber,
index: Index
) -> Result<Option<Transaction>>;
}
Expand description
Trait that provides necessary data when forking a remote chain. The method signatures are similar to methods from ETHNamespace and ZKNamespace.
Required Methods§
sourcefn get_storage_at(
&self,
address: Address,
idx: U256,
block: Option<BlockIdVariant>
) -> Result<H256>
fn get_storage_at( &self, address: Address, idx: U256, block: Option<BlockIdVariant> ) -> Result<H256>
Returns the Storage value at a given index for given address.
sourcefn get_bytecode_by_hash(&self, hash: H256) -> Result<Option<Vec<u8>>>
fn get_bytecode_by_hash(&self, hash: H256) -> Result<Option<Vec<u8>>>
Returns the bytecode stored under this hash (if available).
sourcefn get_transaction_by_hash(&self, hash: H256) -> Result<Option<Transaction>>
fn get_transaction_by_hash(&self, hash: H256) -> Result<Option<Transaction>>
Returns the transaction for a given hash.
sourcefn get_raw_block_transactions(
&self,
block_number: MiniblockNumber
) -> Result<Vec<Transaction>>
fn get_raw_block_transactions( &self, block_number: MiniblockNumber ) -> Result<Vec<Transaction>>
Gets all transactions that belong to a given miniblock.
sourcefn get_block_by_hash(
&self,
hash: H256,
full_transactions: bool
) -> Result<Option<Block<TransactionVariant>>>
fn get_block_by_hash( &self, hash: H256, full_transactions: bool ) -> Result<Option<Block<TransactionVariant>>>
Returns the block for a given hash.
sourcefn get_block_by_number(
&self,
block_number: BlockNumber,
full_transactions: bool
) -> Result<Option<Block<TransactionVariant>>>
fn get_block_by_number( &self, block_number: BlockNumber, full_transactions: bool ) -> Result<Option<Block<TransactionVariant>>>
Returns the block for a given number.
sourcefn get_block_transaction_count_by_hash(
&self,
block_hash: H256
) -> Result<Option<U256>>
fn get_block_transaction_count_by_hash( &self, block_hash: H256 ) -> Result<Option<U256>>
Returns the transaction count for a given block hash.
sourcefn get_block_transaction_count_by_number(
&self,
block_number: BlockNumber
) -> Result<Option<U256>>
fn get_block_transaction_count_by_number( &self, block_number: BlockNumber ) -> Result<Option<U256>>
Returns the transaction count for a given block number.
sourcefn get_transaction_by_block_hash_and_index(
&self,
block_hash: H256,
index: Index
) -> Result<Option<Transaction>>
fn get_transaction_by_block_hash_and_index( &self, block_hash: H256, index: Index ) -> Result<Option<Transaction>>
Returns information about a transaction by block hash and transaction index position.
sourcefn get_transaction_by_block_number_and_index(
&self,
block_number: BlockNumber,
index: Index
) -> Result<Option<Transaction>>
fn get_transaction_by_block_number_and_index( &self, block_number: BlockNumber, index: Index ) -> Result<Option<Transaction>>
Returns information about a transaction by block number and transaction index position.