Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
malik672 committed Oct 20, 2024
1 parent ae5a2e7 commit 1b0b816
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions crates/blockchain-tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ optimism = [
"reth-db/optimism",
"reth-db-api/optimism"
]

[[bench]]
name = "bench"
harness = false
14 changes: 8 additions & 6 deletions crates/blockchain-tree/benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#![allow(missing_docs)]

#![allow(clippy::field_reassign_with_default)]
use alloy_consensus::Header;
use alloy_primitives::BlockHash;
use criterion::{self, black_box, criterion_group, criterion_main, Criterion};
use reth_blockchain_tree::BlockBuffer;
use reth_primitives::{BlockBody, SealedBlock, SealedBlockWithSenders, SealedHeader};

pub fn create_block(_number: u64, _parent: BlockHash) -> SealedBlockWithSenders {
let _rng = rand::thread_rng();
let mut header = Header::default();
header.number = _number;
header.parent_hash = _parent;

let header = Header::default();
let s_header = SealedHeader::new(header, BlockHash::random());
let block_hash = BlockHash::random();
let s_header = SealedHeader::new(header, block_hash);

let a = BlockBody::default();
let sealed_block = SealedBlock::new(s_header, a);
let body = BlockBody::default();
let sealed_block = SealedBlock::new(s_header, body);
SealedBlockWithSenders::new(sealed_block, vec![]).unwrap()
}

Expand Down

0 comments on commit 1b0b816

Please sign in to comment.