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

rpc: rm from_primitive_with_hash in rpc-types-compat #12011

Closed
tcoratger opened this issue Oct 23, 2024 · 2 comments
Closed

rpc: rm from_primitive_with_hash in rpc-types-compat #12011

tcoratger opened this issue Oct 23, 2024 · 2 comments
Labels
C-enhancement New feature or request S-needs-triage This issue needs to be labelled

Comments

@tcoratger
Copy link
Contributor

Describe the feature

As long as alloy-rs/alloy#1532 is merged, we can wait the next release of alloy and use this conversion implementation

https://github.com/alloy-rs/alloy/blob/31a5cf22a470452877221c4ef5c6940532e4ca7b/crates/rpc-types-eth/src/block.rs#L179-L233

instead of from_primitive_with_hash in rpc-types-compat:

pub fn from_primitive_with_hash(primitive_header: reth_primitives::SealedHeader) -> Header {
let (header, hash) = primitive_header.split();
let PrimitiveHeader {
parent_hash,
ommers_hash,
beneficiary,
state_root,
transactions_root,
receipts_root,
logs_bloom,
difficulty,
number,
gas_limit,
gas_used,
timestamp,
mix_hash,
nonce,
base_fee_per_gas,
extra_data,
withdrawals_root,
blob_gas_used,
excess_blob_gas,
parent_beacon_block_root,
requests_hash,
} = header;
Header {
hash,
parent_hash,
uncles_hash: ommers_hash,
miner: beneficiary,
state_root,
transactions_root,
receipts_root,
withdrawals_root,
number,
gas_used,
gas_limit,
extra_data,
logs_bloom,
timestamp,
difficulty,
mix_hash: Some(mix_hash),
nonce: Some(nonce),
base_fee_per_gas,
blob_gas_used,
excess_blob_gas,
parent_beacon_block_root,
total_difficulty: None,
requests_hash,
}
}

Additional context

No response

@tcoratger tcoratger added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Oct 23, 2024
@nadtech-hub
Copy link
Contributor

Could you assign it to me?

@mattsse
Copy link
Collaborator

mattsse commented Nov 13, 2024

we have since removed this

@mattsse mattsse closed this as completed Nov 13, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request S-needs-triage This issue needs to be labelled
Projects
Status: Done
Development

No branches or pull requests

3 participants