[Feature] enforce `ReceiptEnvelope` embedding by adding trait bound
- Dominant language
- Rust
- Stars
- 1.3k
- Forks
- 668
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 29
Description
`::ReceiptResponse` should ALWAYS embed the `::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` 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`
_Originally posted by @mattsse in https://github.com/alloy-rs/alloy/issues/846#issuecomment-2156043828_
```
Contributor guide
Assessment
This issue has not been assessed yet.