alloy-rs / alloy

Transports, Middleware, and Networks for the Alloy project
https://alloy.rs
Apache License 2.0
664 stars 239 forks source link

rpc: add `uncle_block_from_header` impl and test #1554

Closed tcoratger closed 1 month ago

tcoratger commented 1 month ago

The goal here is similar to https://github.com/alloy-rs/alloy/pull/1532

In reth we have:

https://github.com/paradigmxyz/reth/blob/2ae93682b4978bf80bf27c777334ead30d3e04f5/crates/rpc/rpc-types-compat/src/block.rs#L178-L192

And I have found myself several times in the situation where I was forced to go through the reth-rpc-types-compat crate just for this small conversion.

Seems like more logical and smooth to have it directly in alloy since the target type is an alloy rpc type.

I did a test against reth implementation to check the results are the same

image