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

Network::HeaderResponse does not contain hash #1626

Closed
Wollac opened this issue Nov 6, 2024 · 1 comment · Fixed by #1627
Closed

Network::HeaderResponse does not contain hash #1626

Wollac opened this issue Nov 6, 2024 · 1 comment · Fixed by #1627
Labels
bug Something isn't working

Comments

@Wollac
Copy link
Contributor

Wollac commented Nov 6, 2024

Component

network, json-rpc

What version of Alloy are you on?

alloy-network v0.6.0

Operating System

None

Describe the bug

With the recent changes in #1573, there is no longer a way to get the block hash from a generic alloy_network::Network response. The HeaderResponse now only contains the actual header, but no additional fields like the hash.
I expected that there would be a wrapper (similar to alloy_rpc_types_eth::Header) that would either store this hash directly, or if for some reason this is considered too Ethereum specific, at least some other_fields mechanism. Such behavior would also be consistent with the BlockResponse, and previous versions of alloy allowed direct access to the hash.

@Wollac Wollac added the bug Something isn't working label Nov 6, 2024
@mattsse
Copy link
Member

mattsse commented Nov 6, 2024

right, thanks for flagging.

imo @klkvr the easiest way to make this convenient is introducing a trait (HeaderResponse) or we can add some restriction to Sealed<&Self::Header>.

the former is likely easier.

perhaps we can introduce a general purpose trait for the hash, like Sealed but as a trait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants