pub trait ForkSource:
Debug
+ Send
+ Sync {
Show 21 methods
// Required methods
fn dyn_cloned(&self) -> Box<dyn ForkSource>;
fn url(&self) -> Option<Url>;
fn details(&self) -> Option<ForkDetails>;
fn get_storage_at<'life0, 'async_trait>(
&'life0 self,
address: Address,
idx: U256,
block: Option<BlockIdVariant>,
) -> Pin<Box<dyn Future<Output = Result<H256>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_storage_at_forked<'life0, 'async_trait>(
&'life0 self,
address: Address,
idx: U256,
) -> Pin<Box<dyn Future<Output = Result<H256>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_bytecode_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_transaction_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_transaction_details<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<TransactionDetails>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_raw_block_transactions<'life0, 'async_trait>(
&'life0 self,
block_number: L2BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Vec<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_details<'life0, 'async_trait>(
&'life0 self,
block_number: L2BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockDetails>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_transaction_count_by_hash<'life0, 'async_trait>(
&'life0 self,
block_hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_transaction_count_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_transaction_by_block_hash_and_index<'life0, 'async_trait>(
&'life0 self,
block_hash: H256,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_transaction_by_block_number_and_index<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_bridge_contracts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<BridgeAddresses>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_confirmed_tokens<'life0, 'async_trait>(
&'life0 self,
from: u32,
limit: u8,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Token>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn get_block_by_id<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_block_transaction_count_by_id<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_transaction_by_block_id_and_index<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Trait that provides necessary data when forking a remote chain.
Most methods’ signatures are similar to corresponding methods from [EthNamespaceClient
] and [ZksNamespaceClient
]
but with domain-specific types where that makes sense. Additionally, return types are wrapped
into anyhow::Result
to avoid leaking RPC-specific implementation details.
Required Methods§
Sourcefn dyn_cloned(&self) -> Box<dyn ForkSource>
fn dyn_cloned(&self) -> Box<dyn ForkSource>
Alternative for Clone::clone
that is object safe.
Sourcefn url(&self) -> Option<Url>
fn url(&self) -> Option<Url>
Human-readable description on the fork’s origin. None if there is no fork.
Sourcefn details(&self) -> Option<ForkDetails>
fn details(&self) -> Option<ForkDetails>
Details on the fork’s state at the moment when we forked from it. None if there is no fork.
Sourcefn get_storage_at<'life0, 'async_trait>(
&'life0 self,
address: Address,
idx: U256,
block: Option<BlockIdVariant>,
) -> Pin<Box<dyn Future<Output = Result<H256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_storage_at<'life0, 'async_trait>(
&'life0 self,
address: Address,
idx: U256,
block: Option<BlockIdVariant>,
) -> Pin<Box<dyn Future<Output = Result<H256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s storage value at a given index for given address for the forked blocked.
Sourcefn get_storage_at_forked<'life0, 'async_trait>(
&'life0 self,
address: Address,
idx: U256,
) -> Pin<Box<dyn Future<Output = Result<H256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_storage_at_forked<'life0, 'async_trait>(
&'life0 self,
address: Address,
idx: U256,
) -> Pin<Box<dyn Future<Output = Result<H256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s storage value at a given index for given address for the forked blocked.
Sourcefn get_bytecode_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_bytecode_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the bytecode stored under this hash (if available).
Sourcefn get_transaction_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transaction_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transaction for a given hash.
Sourcefn get_transaction_details<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<TransactionDetails>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transaction_details<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<TransactionDetails>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transaction details for a given hash.
Sourcefn get_raw_block_transactions<'life0, 'async_trait>(
&'life0 self,
block_number: L2BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Vec<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_raw_block_transactions<'life0, 'async_trait>(
&'life0 self,
block_number: L2BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Vec<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transactions that belong to a block with the given number.
Sourcefn get_block_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s block for a given hash.
Sourcefn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s block for a given number.
Sourcefn get_block_details<'life0, 'async_trait>(
&'life0 self,
block_number: L2BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockDetails>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_details<'life0, 'async_trait>(
&'life0 self,
block_number: L2BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockDetails>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s block details for a given block number.
Sourcefn get_block_transaction_count_by_hash<'life0, 'async_trait>(
&'life0 self,
block_hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_transaction_count_by_hash<'life0, 'async_trait>(
&'life0 self,
block_hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transaction count for a given block hash.
Sourcefn get_block_transaction_count_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_transaction_count_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transaction count for a given block number.
Sourcefn get_transaction_by_block_hash_and_index<'life0, 'async_trait>(
&'life0 self,
block_hash: H256,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transaction_by_block_hash_and_index<'life0, 'async_trait>(
&'life0 self,
block_hash: H256,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transaction by block hash and transaction index position.
Sourcefn get_transaction_by_block_number_and_index<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transaction_by_block_number_and_index<'life0, 'async_trait>(
&'life0 self,
block_number: BlockNumber,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transaction by block number and transaction index position.
Provided Methods§
Sourcefn get_block_by_id<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_by_id<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<Block<TransactionVariant>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s block for a given id.
Sourcefn get_block_transaction_count_by_id<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_transaction_count_by_id<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transaction count for a given block id.
Sourcefn get_transaction_by_block_id_and_index<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transaction_by_block_id_and_index<'life0, 'async_trait>(
&'life0 self,
block_id: BlockId,
index: Index,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches fork’s transaction by block id and transaction index position.