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] Make alloy_rpc_types_eth::Block generic over header #1177

Closed
emhane opened this issue Aug 22, 2024 · 0 comments · Fixed by #1179
Closed

[Feature] Make alloy_rpc_types_eth::Block generic over header #1177

emhane opened this issue Aug 22, 2024 · 0 comments · Fixed by #1179
Labels
debt Tech debt which needs to be addressed

Comments

@emhane
Copy link
Contributor

emhane commented Aug 22, 2024

Component

rpc

Describe the feature you would like

Make Block generic over header type, for using Block<alloy_network::Network::HeaderResponse> in reth RPC.

/// Block representation
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Block<T = Transaction> {
/// Header of the block.
#[serde(flatten)]
pub header: Header,
/// Uncles' hashes.
#[serde(default)]
pub uncles: Vec<B256>,
/// Block Transactions. In the case of an uncle block, this field is not included in RPC
/// responses, and when deserialized, it will be set to [BlockTransactions::Uncle].
#[serde(
default = "BlockTransactions::uncle",
skip_serializing_if = "BlockTransactions::is_uncle"
)]
pub transactions: BlockTransactions<T>,
/// Integer the size of this block in bytes.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub size: Option<U256>,
/// Withdrawals in the block.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub withdrawals: Option<Vec<Withdrawal>>,
}

Additional context

No response

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 a pull request may close this issue.

1 participant