chore: make block field private (#13628)

This commit is contained in:
Matthias Seitz
2025-01-03 16:10:32 +01:00
committed by GitHub
parent 82013f46da
commit dbd4f0c4fe
67 changed files with 317 additions and 291 deletions

View File

@ -84,7 +84,7 @@ where
eyre::bail!("Invalid number of bodies received. Expected: 1. Received: 0")
};
let block = SealedBlock { header, body };
let block = SealedBlock::new(header, body);
consensus.validate_block_pre_execution(&block)?;
Ok(block)

View File

@ -254,7 +254,7 @@ impl NodeState {
number=block.number(),
hash=?block.hash(),
peers=self.num_connected_peers(),
txs=block.body.transactions().len(),
txs=block.body().transactions().len(),
gas=%format_gas(block.header.gas_used()),
gas_throughput=%format_gas_throughput(block.header.gas_used(), elapsed),
full=%format!("{:.1}%", block.header.gas_used() as f64 * 100.0 / block.header.gas_limit() as f64),