Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoopmann committed Sep 30, 2023
1 parent 45f233b commit d19af4b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 10 additions & 2 deletions src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ where
try_into_sealed_block(request_body.execution_payload.into(), None).to_rpc_result()?;
let chain_spec = self.provider().chain_spec();

compare_values("ParentHash", request_body.message.parent_hash, block.parent_hash)?;
compare_values(
"ParentHash",
request_body.message.parent_hash,
block.parent_hash,
)?;
compare_values("BlockHash", request_body.message.block_hash, block.hash())?;
compare_values("GasLimit", request_body.message.gas_limit, block.gas_limit)?;
compare_values("GasUsed", request_body.message.gas_used, block.gas_used)?;
Expand Down Expand Up @@ -95,7 +99,11 @@ pub struct ValidationApiInner<Provider> {
provider: Provider,
}

fn compare_values<T: std::cmp::PartialEq + std::fmt::Display>(name: &str, expected: T, actual: T) -> RpcResult<()> {
fn compare_values<T: std::cmp::PartialEq + std::fmt::Display>(
name: &str,
expected: T,
actual: T,
) -> RpcResult<()> {
if expected != actual {
Err(internal_rpc_err(format!(
"incorrect {} {}, expected {}",
Expand Down
10 changes: 5 additions & 5 deletions src/rpc/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use derivative::Derivative;
use reth::primitives::{Address, Bloom, Bytes, H256, U256};
use reth::primitives::{Address, Bloom, Bytes, H256, U256, U64};
use reth::rpc::types::{ExecutionPayload, ExecutionPayloadV1, ExecutionPayloadV2, Withdrawal};
use serde::{Deserialize, Serialize};
use serde_with::{serde_as, DisplayFromStr};
Expand Down Expand Up @@ -89,10 +89,10 @@ impl From<ExecutionPayloadValidation> for ExecutionPayload {
receipts_root: val.receipts_root,
logs_bloom: val.logs_bloom,
prev_randao: val.prev_randao,
block_number: val.block_number.into(),
gas_limit: val.gas_limit.into(),
gas_used: val.gas_used.into(),
timestamp: val.timestamp.into(),
block_number: U64::from(val.block_number),
gas_limit: U64::from(val.gas_limit),
gas_used: U64::from(val.gas_used),
timestamp: U64::from(val.timestamp),
extra_data: val.extra_data,
base_fee_per_gas: val.base_fee_per_gas,
block_hash: val.block_hash,
Expand Down

0 comments on commit d19af4b

Please sign in to comment.