11use alloy:: primitives:: { Address , TxHash } ;
22use alloy:: providers:: Provider ;
3+ use alloy:: rpc:: types:: TransactionReceipt ;
34use engine_core:: error:: { AlloyRpcErrorToEngineError , EngineError } ;
45use engine_core:: {
56 chain:: { Chain , ChainService , RpcCredentials } ,
@@ -52,10 +53,8 @@ impl HasTransactionMetadata for Eip7702ConfirmationJobData {
5253pub struct Eip7702ConfirmationResult {
5354 pub transaction_id : String ,
5455 pub transaction_hash : TxHash ,
56+ pub receipt : TransactionReceipt ,
5557 pub eoa_address : Address ,
56- pub block_number : Option < u64 > ,
57- pub gas_used : Option < u64 > ,
58- pub status : bool ,
5958}
6059
6160// --- Error Types ---
@@ -84,7 +83,10 @@ pub enum Eip7702ConfirmationError {
8483 } ,
8584
8685 #[ error( "Transaction failed: {message}" ) ]
87- TransactionFailed { message : String } ,
86+ TransactionFailed {
87+ message : String ,
88+ receipt : TransactionReceipt ,
89+ } ,
8890
8991 #[ error( "Invalid RPC Credentials: {message}" ) ]
9092 InvalidRpcCredentials { message : String } ,
@@ -239,6 +241,7 @@ where
239241 if !success {
240242 return Err ( Eip7702ConfirmationError :: TransactionFailed {
241243 message : "Transaction reverted" . to_string ( ) ,
244+ receipt,
242245 } )
243246 . map_err_fail ( ) ;
244247 }
@@ -253,10 +256,8 @@ where
253256 Ok ( Eip7702ConfirmationResult {
254257 transaction_id : job_data. transaction_id . clone ( ) ,
255258 transaction_hash,
259+ receipt,
256260 eoa_address : job_data. eoa_address ,
257- block_number : receipt. block_number ,
258- gas_used : Some ( receipt. gas_used ) ,
259- status : success,
260261 } )
261262 }
262263
0 commit comments