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] enforce ReceiptEnvelope embedding by adding trait bound #854

Open
prestwich opened this issue Jun 8, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@prestwich
Copy link
Member

<N as Network>::ReceiptResponse should ALWAYS embed the <N as Network>::ReceiptEnvelope in itself

To enforce that we should

  • add + Receipt + AsRef + AsMut + Into bounds to the Network trait's ReceiptResponse type

Followup work

  • define BlockContext as it seems to be a set of shared RPC keys
              cc @mattsse should `type ReceiptResponse: ReceiptResponse` also be constrained to ` + AsRef<Self::ReceiptEnvelope>` to ensure that network implementers ALWAYS embed the envelope in the response?

_Originally posted by @prestwich in https://github.com/alloy-rs/alloy/issues/846#issuecomment-2155381974_

              ah, right this way we could enforce embedding the receipt type in rpc, so `ReceiptResponse is Receipt + BlockContext`

this makes sense, then we could also add `Into<Self::ReceiptEnvelope>`

_Originally posted by @mattsse in https://github.com/alloy-rs/alloy/issues/846#issuecomment-2156043828_
            
@prestwich prestwich changed the title [Feature]: enforce ReceiptEnvelope embedding by [Feature] enforce ReceiptEnvelope embedding by Jun 8, 2024
@prestwich prestwich added the enhancement New feature or request label Jun 8, 2024
@prestwich prestwich changed the title [Feature] enforce ReceiptEnvelope embedding by [Feature] enforce ReceiptEnvelope embedding by adding trait bound Jun 15, 2024
@prestwich
Copy link
Member Author

closely related to #623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant