Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions executors/src/eip7702_executor/confirm.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use alloy::primitives::{Address, TxHash};
use alloy::providers::Provider;
use alloy::rpc::types::TransactionReceipt;
use engine_core::error::{AlloyRpcErrorToEngineError, EngineError};
use engine_core::{
chain::{Chain, ChainService, RpcCredentials},
Expand Down Expand Up @@ -52,10 +53,8 @@ impl HasTransactionMetadata for Eip7702ConfirmationJobData {
pub struct Eip7702ConfirmationResult {
pub transaction_id: String,
pub transaction_hash: TxHash,
pub receipt: TransactionReceipt,
pub eoa_address: Address,
pub block_number: Option<u64>,
pub gas_used: Option<u64>,
pub status: bool,
}

// --- Error Types ---
Expand Down Expand Up @@ -84,7 +83,10 @@ pub enum Eip7702ConfirmationError {
},

#[error("Transaction failed: {message}")]
TransactionFailed { message: String },
TransactionFailed {
message: String,
receipt: TransactionReceipt,
},

#[error("Invalid RPC Credentials: {message}")]
InvalidRpcCredentials { message: String },
Expand Down Expand Up @@ -239,6 +241,7 @@ where
if !success {
return Err(Eip7702ConfirmationError::TransactionFailed {
message: "Transaction reverted".to_string(),
receipt,
})
.map_err_fail();
}
Expand All @@ -253,10 +256,8 @@ where
Ok(Eip7702ConfirmationResult {
transaction_id: job_data.transaction_id.clone(),
transaction_hash,
receipt,
eoa_address: job_data.eoa_address,
block_number: receipt.block_number,
gas_used: Some(receipt.gas_used),
status: success,
})
}

Expand Down