Skip to content

[Feature] Add network-parameterized block responses #267

Closed
@onbjerg

Description

@onbjerg

Component

network, json-rpc, providers, pubsub

Describe the feature you would like

#190 replaced the provider with a network-parameterized provider, but block responses are still just Ethereum headers and Ethereum transactions. We need a Block type generic for networks.

We have one in alloy-network but we need to check that it is correct and use it in alloy-providers:

pub enum TransactionList<T> {
/// Hashes only.
Hashes(Vec<B256>),
/// Hydrated tx objects.
Hydrated(Vec<T>),
/// Special case for uncle response
Uncled,
}
/// A block response
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
pub struct BlockResponse<N: Network> {
#[serde(flatten)]
header: N::HeaderResponse,
transactions: TransactionList<N::TransactionResponse>,
}

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    debtTech debt which needs to be addressedenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions