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

Make additional TxReceipt impls generic over T #617

Merged
merged 10 commits into from
Apr 24, 2024

Conversation

developeruche
Copy link
Contributor

Motivation

Closes #606

Solution

Just made the impl and extended the trait bound on ReceiptWithBloom

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Comment on lines +46 to +47
where
T: Borrow<Log>,
Copy link
Member

Choose a reason for hiding this comment

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

do we want this? thought we may want to be generic over this and do T = Log perhaps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pub fn bloom_slow(&self) -> Bloom {
        self.logs.iter().map(Borrow::borrow).collect()
}

We made use of this here;
We might have to change this implementation, thou Log works for most of the use-cases I can think of now.

Copy link
Member

Choose a reason for hiding this comment

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

it's a bit more complicated and we will need more work here. Because Log is actually Log<T = LogData> we want to be able to implement generically across a wide variety of types, and may need to introduce a trait Log in order to do it

For now, this is an improvement over the existing state of things so we might as well

@onbjerg onbjerg added the debt Tech debt which needs to be addressed label Apr 24, 2024
@prestwich prestwich merged commit e4fb669 into alloy-rs:main Apr 24, 2024
18 checks passed
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

* mod: impl TxReceipt trait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Tech debt which needs to be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make additional TxReceipt impls generic over T
6 participants