Skip to content

Commit 6be3247

Browse files
send receipts in 7702 success webhooks (#9)
1 parent ca790e8 commit 6be3247

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

executors/src/eip7702_executor/confirm.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use alloy::primitives::{Address, TxHash};
22
use alloy::providers::Provider;
3+
use alloy::rpc::types::TransactionReceipt;
34
use engine_core::error::{AlloyRpcErrorToEngineError, EngineError};
45
use engine_core::{
56
chain::{Chain, ChainService, RpcCredentials},
@@ -52,10 +53,8 @@ impl HasTransactionMetadata for Eip7702ConfirmationJobData {
5253
pub 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

Comments
 (0)