11use crate :: {
22 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 ,
44} ;
55use alloy:: {
66 consensus:: { Transaction , TxEip4844Variant , TxEnvelope } ,
@@ -299,10 +299,10 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthCallBundle, EthCallBundleResp
299299 let mut trevm = trevm;
300300
301301 // 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) ;
303303
304304 // 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 ! (
306306 trevm. try_read_balance( trevm. inner( ) . block( ) . coinbase) . map_err( |e| {
307307 BundleError :: EVMError { inner: revm:: primitives:: EVMError :: Database ( e) }
308308 } ) ,
@@ -332,7 +332,7 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthCallBundle, EthCallBundleResp
332332 let basefee = committed_trevm. inner ( ) . block ( ) . basefee ;
333333
334334 // Get the post simulation coinbase balance
335- let post_sim_coinbase_balance = unwrap_or_trevm_err ! (
335+ let post_sim_coinbase_balance = trevm_try ! (
336336 committed_trevm. try_read_balance( coinbase) . map_err( |e| {
337337 BundleError :: EVMError {
338338 inner: revm:: primitives:: EVMError :: Database ( e) ,
@@ -342,7 +342,7 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthCallBundle, EthCallBundleResp
342342 ) ;
343343
344344 // 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 ! (
346346 Self :: process_call_bundle_tx(
347347 tx,
348348 pre_sim_coinbase_balance,
@@ -437,7 +437,7 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthSendBundle, EthBundleHash> {
437437 trevm_ensure ! ( !self . bundle. txs. is_empty( ) , trevm, BundleError :: BundleEmpty ) ;
438438
439439 // 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) ;
441441
442442 // Store the current evm state in this mutable variable, so we can continually use the freshest state for each simulation
443443 let mut t = trevm;
@@ -573,7 +573,7 @@ impl<Ext> BundleDriver<Ext> for EthCallBundle {
573573 let run_result = trevm. try_with_block ( & bundle_filler, |trevm| {
574574 let mut trevm = trevm;
575575
576- let txs = unwrap_or_trevm_err ! (
576+ let txs = trevm_try ! (
577577 self . txs
578578 . iter( )
579579 . map( |tx| TxEnvelope :: decode_2718( & mut tx. chunk( ) ) )
@@ -669,7 +669,7 @@ impl<Ext> BundleDriver<Ext> for EthSendBundle {
669669 // Check if the bundle has any transactions
670670 trevm_ensure ! ( !self . txs. is_empty( ) , trevm, BundleError :: BundleEmpty ) ;
671671
672- let txs = unwrap_or_trevm_err ! (
672+ let txs = trevm_try ! (
673673 self . txs
674674 . iter( )
675675 . map( |tx| TxEnvelope :: decode_2718( & mut tx. chunk( ) ) )
0 commit comments