1
1
use crate :: {
2
2
system:: { MAX_BLOB_GAS_PER_BLOCK_CANCUN , MAX_BLOB_GAS_PER_BLOCK_PRAGUE } ,
3
- trevm_bail, trevm_ensure, unwrap_or_trevm_err , Block , BundleDriver , DriveBundleResult ,
3
+ trevm_bail, trevm_ensure, trevm_try , Block , BundleDriver , DriveBundleResult ,
4
4
} ;
5
5
use alloy:: {
6
6
consensus:: { Transaction , TxEip4844Variant , TxEnvelope } ,
@@ -299,10 +299,10 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthCallBundle, EthCallBundleResp
299
299
let mut trevm = trevm;
300
300
301
301
// Decode and validate the transactions in the bundle
302
- let txs = unwrap_or_trevm_err ! ( Self :: decode_and_validate_txs( & self . bundle. txs) , trevm) ;
302
+ let txs = trevm_try ! ( Self :: decode_and_validate_txs( & self . bundle. txs) , trevm) ;
303
303
304
304
// Cache the pre simulation coinbase balance, so we can use it to calculate the coinbase diff after every tx simulated.
305
- let initial_coinbase_balance = unwrap_or_trevm_err ! (
305
+ let initial_coinbase_balance = trevm_try ! (
306
306
trevm. try_read_balance( trevm. inner( ) . block( ) . coinbase) . map_err( |e| {
307
307
BundleError :: EVMError { inner: revm:: primitives:: EVMError :: Database ( e) }
308
308
} ) ,
@@ -332,7 +332,7 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthCallBundle, EthCallBundleResp
332
332
let basefee = committed_trevm. inner ( ) . block ( ) . basefee ;
333
333
334
334
// Get the post simulation coinbase balance
335
- let post_sim_coinbase_balance = unwrap_or_trevm_err ! (
335
+ let post_sim_coinbase_balance = trevm_try ! (
336
336
committed_trevm. try_read_balance( coinbase) . map_err( |e| {
337
337
BundleError :: EVMError {
338
338
inner: revm:: primitives:: EVMError :: Database ( e) ,
@@ -342,7 +342,7 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthCallBundle, EthCallBundleResp
342
342
) ;
343
343
344
344
// Process the transaction and accumulate the results
345
- let ( response, post_sim_coinbase_balance) = unwrap_or_trevm_err ! (
345
+ let ( response, post_sim_coinbase_balance) = trevm_try ! (
346
346
Self :: process_call_bundle_tx(
347
347
tx,
348
348
pre_sim_coinbase_balance,
@@ -437,7 +437,7 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthSendBundle, EthBundleHash> {
437
437
trevm_ensure ! ( !self . bundle. txs. is_empty( ) , trevm, BundleError :: BundleEmpty ) ;
438
438
439
439
// Decode and validate the transactions in the bundle
440
- let txs = unwrap_or_trevm_err ! ( Self :: decode_and_validate_txs( & self . bundle. txs) , trevm) ;
440
+ let txs = trevm_try ! ( Self :: decode_and_validate_txs( & self . bundle. txs) , trevm) ;
441
441
442
442
// Store the current evm state in this mutable variable, so we can continually use the freshest state for each simulation
443
443
let mut t = trevm;
@@ -573,7 +573,7 @@ impl<Ext> BundleDriver<Ext> for EthCallBundle {
573
573
let run_result = trevm. try_with_block ( & bundle_filler, |trevm| {
574
574
let mut trevm = trevm;
575
575
576
- let txs = unwrap_or_trevm_err ! (
576
+ let txs = trevm_try ! (
577
577
self . txs
578
578
. iter( )
579
579
. map( |tx| TxEnvelope :: decode_2718( & mut tx. chunk( ) ) )
@@ -669,7 +669,7 @@ impl<Ext> BundleDriver<Ext> for EthSendBundle {
669
669
// Check if the bundle has any transactions
670
670
trevm_ensure ! ( !self . txs. is_empty( ) , trevm, BundleError :: BundleEmpty ) ;
671
671
672
- let txs = unwrap_or_trevm_err ! (
672
+ let txs = trevm_try ! (
673
673
self . txs
674
674
. iter( )
675
675
. map( |tx| TxEnvelope :: decode_2718( & mut tx. chunk( ) ) )
0 commit comments