-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Component
Anvil
Describe the feature you would like
we want support for debugtrace_transaction an JS tracing for anvil
ref #11052
to do this we need a new helper function that works like
foundry/crates/anvil/src/eth/backend/mem/mod.rs
Lines 2367 to 2375 in 575279d
/// Helper function to execute a closure with the database at a specific block | |
pub async fn with_database_at<F, T>( | |
&self, | |
block_request: Option<BlockRequest>, | |
f: F, | |
) -> Result<T, BlockchainError> | |
where | |
F: FnOnce(Box<dyn MaybeFullDatabase + '_>, BlockEnv) -> T, | |
{ |
but also transacts all previous txs before the target tx in a block
basically like this
this is more or less how
foundry/crates/anvil/src/eth/backend/mem/mod.rs
Lines 1232 to 1242 in 575279d
/// Creates the pending block | |
/// | |
/// This will execute all transaction in the order they come but will not mine the block | |
pub async fn with_pending_block<F, T>( | |
&self, | |
pool_transactions: Vec<Arc<PoolTransaction>>, | |
f: F, | |
) -> T | |
where | |
F: FnOnce(Box<dyn MaybeFullDatabase + '_>, BlockInfo) -> T, | |
{ |
already works, so we can adapt this a bit so that it works with a set of txs, a new helper fns
TODO
- add debug_traceTransaction handling for JS and add required functionality
Additional context
No response
Soubhik-10
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done