anvil::config

Function derive_block_and_transactions

Source
async fn derive_block_and_transactions(
    fork_choice: &ForkChoice,
    provider: &Arc<RetryProvider>,
) -> Result<(BlockNumber, Option<Vec<PoolTransaction>>)>
Expand description

If the fork choice is a block number, simply return it with an empty list of transactions. If the fork choice is a transaction hash, determine the block that the transaction was mined in, and return the block number before the fork block along with all transactions in the fork block that are before (and including) the fork transaction.