Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Receipt trait in alloy-consensus #477

Merged
merged 8 commits into from
Apr 23, 2024

Conversation

developeruche
Copy link
Contributor

Motivation

Closes #466

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@developeruche
Copy link
Contributor Author

@prestwich change status function on rpc receipt type to delegate to Receipt implementation of inner

This is not quite possible at the moment;

pub enum ReceiptEnvelope<T = Log> ----> This uses Log from use alloy_primitives::{Bloom, Log};

and

pub struct TransactionReceipt<T = ReceiptEnvelope> ----> This uses Log from rpc-type making the trait bound not satified... that's is Receipt implementation of inner is not accessiable

crates/consensus/src/receipt/any.rs Outdated Show resolved Hide resolved
crates/consensus/src/receipt/any.rs Outdated Show resolved Hide resolved
crates/consensus/src/receipt/envelope.rs Outdated Show resolved Hide resolved
crates/network/src/lib.rs Show resolved Hide resolved
@developeruche developeruche requested a review from prestwich April 22, 2024 23:00
@prestwich prestwich merged commit 55c84be into alloy-rs:main Apr 23, 2024
18 checks passed
@@ -43,7 +43,7 @@ where
}

impl TxReceipt for Receipt {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup work:

  • Make this impl generic over

@@ -78,7 +78,7 @@ pub struct ReceiptWithBloom<T = Log> {
}

impl TxReceipt for ReceiptWithBloom {
fn success(&self) -> bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup work:

  • Make this impl generic over

ben186 pushed a commit to ben186/alloy that referenced this pull request Jul 27, 2024
* introduced Receipt trait

* fmt

* mod: switch to TxReceipt trait

* fmt

* impl Receipt for ReceiptEnvelope

* mod: removed todo()

* resovling comments and CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Receipt trait in alloy-consensus
2 participants