-
Notifications
You must be signed in to change notification settings - Fork 271
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
dedup: TransactionList and BlockResponse #444
Conversation
/// A block response | ||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] | ||
pub struct BlockResponse<N: Network> { | ||
#[serde(flatten)] | ||
header: N::HeaderResponse, | ||
transactions: TransactionList<N::TransactionResponse>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably do the following while we're here:
- delete this block response as unused and close [Bug] Dedupe
alloy_consensus::BlockResponse<N>
andalloy_rpc_types::Block
#441 - make
TransactionList
generic overT
if it's not already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TransactionList
is already generic over T, I was removing it in favour of BlockTransactions
(which does have a generic) from rpc-types
.
Also if we're removing BlockResponse
we can also remove TransactionList
as it is the only place it is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BlockTransactions
is not currently generic, and should be for reuse in other networks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave TransactionsList
as is but would like to change the Hydrated
enum value to Full
to be consistent with BlockTransactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like we're having a miscommunication here so i'm gonna step back
- the 2 types in alloy-network lib.rs should be deleted as they're duplicative
- the types in alloy-rpc-types should have generics added with defaults
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds great! That's ideal.
* dedup: TransactionList * dedup: BlockResponse in `network` * fix: ci * add: generic to BlockTransactions
Motivation
Ref #440 and #441
Solution
Removed
TransactionList
from alloy_networkPR Checklist