Skip to content

Commit

Permalink
Return static Eip658Value from TxReceipt trait method (#1394)
Browse files Browse the repository at this point in the history
Return static Eip658Value from TxReceipt trait method
  • Loading branch information
emhane authored Sep 29, 2024
1 parent 599e577 commit b9c9e67
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/consensus/src/receipt/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<T> AnyReceiptEnvelope<T> {
}

impl<T> TxReceipt<T> for AnyReceiptEnvelope<T> {
fn status_or_post_state(&self) -> &Eip658Value {
fn status_or_post_state(&self) -> Eip658Value {
self.inner.status_or_post_state()
}

Expand Down
6 changes: 3 additions & 3 deletions crates/consensus/src/receipt/envelope.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{Receipt, ReceiptWithBloom, TxReceipt, TxType};
use crate::{Eip658Value, Receipt, ReceiptWithBloom, TxReceipt, TxType};
use alloy_eips::eip2718::{Decodable2718, Eip2718Error, Eip2718Result, Encodable2718};
use alloy_primitives::{Bloom, Log};
use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable};
Expand Down Expand Up @@ -108,8 +108,8 @@ impl<T> ReceiptEnvelope<T> {
}

impl<T> TxReceipt<T> for ReceiptEnvelope<T> {
fn status_or_post_state(&self) -> &crate::Eip658Value {
&self.as_receipt().unwrap().status
fn status_or_post_state(&self) -> Eip658Value {
self.as_receipt().unwrap().status
}

fn status(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/src/receipt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub trait TxReceipt<T = Log> {
/// is pre-[EIP-658].
///
/// [EIP-658]: https://eips.ethereum.org/EIPS/eip-658
fn status_or_post_state(&self) -> &Eip658Value;
fn status_or_post_state(&self) -> Eip658Value;

/// Returns true if the transaction was successful OR if the transaction is
/// pre-[EIP-658]. Results for transactions before [EIP-658] are not
Expand Down
8 changes: 4 additions & 4 deletions crates/consensus/src/receipt/receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ impl<T> TxReceipt<T> for Receipt<T>
where
T: Borrow<Log>,
{
fn status_or_post_state(&self) -> &Eip658Value {
&self.status
fn status_or_post_state(&self) -> Eip658Value {
self.status
}

fn status(&self) -> bool {
Expand Down Expand Up @@ -159,8 +159,8 @@ pub struct ReceiptWithBloom<T = Log> {
}

impl<T> TxReceipt<T> for ReceiptWithBloom<T> {
fn status_or_post_state(&self) -> &Eip658Value {
&self.receipt.status
fn status_or_post_state(&self) -> Eip658Value {
self.receipt.status
}

fn status(&self) -> bool {
Expand Down

0 comments on commit b9c9e67

Please sign in to comment.