-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
This old helper looks similar to TransactionBuilder trait's build_unsigned, but it fills silently some fields while the latest returns an error with the list of missing fields.
| pub fn transaction_request_to_typed( |
So the remplacement is not "drop-in" - but I think - it is very beneficial. For now it used in 3 places:
-
EthApi::build_typed_tx_request, imo the whole method should be refactored, by prefilling request and then building typed tx.
foundry/crates/anvil/src/eth/api.rs
Line 3412 in b4d888b
let request = match transaction_request_to_typed(request) { -
determine_base_gas_by_kindhelper, I think we don’t need to build typed tx here as we can simply rely onTransactionBuilderfns to determine type, kind, and access list len.
foundry/crates/anvil/src/eth/api.rs
Line 3621 in b4d888b
match transaction_request_to_typed(request.clone()) { -
Backend::simulate, we can determine proactively tx type and fill missing fields usingTransactionBuildertrait fns, or handlebuild_unsignederror, filling the fields we can then retry. btw this may be wrap into an helper providing similar service as originaltransaction_request_to_typed.
foundry/crates/anvil/src/eth/backend/mem/mod.rs
Line 1764 in b4d888b
let request = transaction_request_to_typed(WithOtherFields::new(request))