mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: use alloy block types (#13518)
This commit is contained in:
@ -18,7 +18,7 @@ use clap::Parser;
|
||||
use csv::Writer;
|
||||
use reth_cli_runner::CliContext;
|
||||
use reth_node_core::args::BenchmarkArgs;
|
||||
use reth_primitives::{Block, BlockExt};
|
||||
use reth_primitives::SealedBlock;
|
||||
use reth_rpc_types_compat::engine::payload::block_to_payload;
|
||||
use std::time::Instant;
|
||||
use tracing::{debug, info};
|
||||
@ -46,8 +46,7 @@ impl Command {
|
||||
let block_res =
|
||||
block_provider.get_block_by_number(next_block.into(), true.into()).await;
|
||||
let block = block_res.unwrap().unwrap();
|
||||
let block_hash = block.header.hash;
|
||||
let block = Block::try_from(block).unwrap().seal(block_hash);
|
||||
let block: SealedBlock = block.try_into().unwrap();
|
||||
let head_block_hash = block.hash();
|
||||
let safe_block_hash = block_provider
|
||||
.get_block_by_number(block.number.saturating_sub(32).into(), false.into());
|
||||
|
||||
@ -16,7 +16,7 @@ use clap::Parser;
|
||||
use csv::Writer;
|
||||
use reth_cli_runner::CliContext;
|
||||
use reth_node_core::args::BenchmarkArgs;
|
||||
use reth_primitives::{Block, BlockExt};
|
||||
use reth_primitives::SealedBlock;
|
||||
use reth_rpc_types_compat::engine::payload::block_to_payload;
|
||||
use std::time::Instant;
|
||||
use tracing::{debug, info};
|
||||
@ -46,8 +46,7 @@ impl Command {
|
||||
let block_res =
|
||||
block_provider.get_block_by_number(next_block.into(), true.into()).await;
|
||||
let block = block_res.unwrap().unwrap();
|
||||
let block_hash = block.header.hash;
|
||||
let block = Block::try_from(block).unwrap().seal(block_hash);
|
||||
let block: SealedBlock = block.try_into().unwrap();
|
||||
|
||||
next_block += 1;
|
||||
sender.send(block).await.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user