Skip to content

Commit

Permalink
feat!:rm 7702 auth items from receipt response
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Jan 7, 2025
1 parent ae64f26 commit adbade4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
11 changes: 1 addition & 10 deletions crates/network-primitives/src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::BlockTransactions;
use alloy_consensus::{BlockHeader, Transaction};
use alloy_eips::eip7702::SignedAuthorization;
use alloy_primitives::{Address, BlockHash, TxHash, B256};
use alloy_serde::WithOtherFields;

use crate::BlockTransactions;

/// Receipt JSON-RPC response.
pub trait ReceiptResponse {
/// Address of the created contract, or `None` if the transaction was not a deployment.
Expand Down Expand Up @@ -50,9 +48,6 @@ pub trait ReceiptResponse {
/// Address of the receiver.
fn to(&self) -> Option<Address>;

/// EIP-7702 Authorization list.
fn authorization_list(&self) -> Option<&[SignedAuthorization]>;

/// Returns the cumulative gas used at this receipt.
fn cumulative_gas_used(&self) -> u64;

Expand Down Expand Up @@ -205,10 +200,6 @@ impl<T: ReceiptResponse> ReceiptResponse for WithOtherFields<T> {
self.inner.to()
}

fn authorization_list(&self) -> Option<&[SignedAuthorization]> {
self.inner.authorization_list()
}

fn cumulative_gas_used(&self) -> u64 {
self.inner.cumulative_gas_used()
}
Expand Down
11 changes: 0 additions & 11 deletions crates/rpc-types-eth/src/transaction/receipt.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::Log;
use alloc::vec::Vec;
use alloy_consensus::{ReceiptEnvelope, TxReceipt, TxType};
use alloy_eips::eip7702::SignedAuthorization;
use alloy_network_primitives::ReceiptResponse;
use alloy_primitives::{Address, BlockHash, TxHash, B256};

Expand Down Expand Up @@ -67,10 +65,6 @@ pub struct TransactionReceipt<T = ReceiptEnvelope<Log>> {
pub to: Option<Address>,
/// Contract address created, or None if not a deployment.
pub contract_address: Option<Address>,
/// The authorization list is a list of tuples that store the address to code which the signer
/// desires to execute in the context of their EOA.
#[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))]
pub authorization_list: Option<Vec<SignedAuthorization>>,
}

impl AsRef<ReceiptEnvelope<Log>> for TransactionReceipt {
Expand Down Expand Up @@ -128,7 +122,6 @@ impl<T> TransactionReceipt<T> {
from: self.from,
to: self.to,
contract_address: self.contract_address,
authorization_list: self.authorization_list,
}
}
}
Expand Down Expand Up @@ -182,10 +175,6 @@ impl<T: TxReceipt<Log = Log>> ReceiptResponse for TransactionReceipt<T> {
self.to
}

fn authorization_list(&self) -> Option<&[SignedAuthorization]> {
self.authorization_list.as_deref()
}

fn cumulative_gas_used(&self) -> u64 {
self.inner.cumulative_gas_used()
}
Expand Down

0 comments on commit adbade4

Please sign in to comment.