mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: make block field private (#13628)
This commit is contained in:
@ -88,7 +88,7 @@ pub trait EthBlocks: LoadBlock {
|
||||
.provider()
|
||||
.pending_block()
|
||||
.map_err(Self::Error::from_eth_err)?
|
||||
.map(|block| block.body.transactions().len()))
|
||||
.map(|block| block.body().transactions().len()))
|
||||
}
|
||||
|
||||
let block_hash = match self
|
||||
@ -105,7 +105,7 @@ pub trait EthBlocks: LoadBlock {
|
||||
.get_sealed_block_with_senders(block_hash)
|
||||
.await
|
||||
.map_err(Self::Error::from_eth_err)?
|
||||
.map(|b| b.body.transactions().len()))
|
||||
.map(|b| b.body().transactions().len()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ pub trait EthBlocks: LoadBlock {
|
||||
self.provider()
|
||||
.pending_block()
|
||||
.map_err(Self::Error::from_eth_err)?
|
||||
.and_then(|block| block.body.ommers().map(|o| o.to_vec()))
|
||||
.and_then(|block| block.body().ommers().map(|o| o.to_vec()))
|
||||
} else {
|
||||
self.provider().ommers_by_id(block_id).map_err(Self::Error::from_eth_err)?
|
||||
}
|
||||
|
||||
@ -314,11 +314,11 @@ pub trait EthCall: EstimateCall + Call + LoadPendingBlock + LoadBlock + FullEthA
|
||||
let mut replay_block_txs = true;
|
||||
|
||||
let num_txs =
|
||||
transaction_index.index().unwrap_or_else(|| block.body.transactions().len());
|
||||
transaction_index.index().unwrap_or_else(|| block.body().transactions().len());
|
||||
// but if all transactions are to be replayed, we can use the state at the block itself,
|
||||
// however only if we're not targeting the pending block, because for pending we can't
|
||||
// rely on the block's state being available
|
||||
if !is_block_target_pending && num_txs == block.body.transactions().len() {
|
||||
if !is_block_target_pending && num_txs == block.body().transactions().len() {
|
||||
at = block.hash();
|
||||
replay_block_txs = false;
|
||||
}
|
||||
|
||||
@ -185,7 +185,7 @@ pub trait EthFees: LoadFee {
|
||||
percentiles,
|
||||
header.gas_used(),
|
||||
header.base_fee_per_gas().unwrap_or_default(),
|
||||
block.body.transactions(),
|
||||
block.body().transactions(),
|
||||
&receipts,
|
||||
)
|
||||
.unwrap_or_default(),
|
||||
|
||||
@ -320,7 +320,7 @@ pub trait Trace:
|
||||
|
||||
let Some(block) = block else { return Ok(None) };
|
||||
|
||||
if block.body.transactions().is_empty() {
|
||||
if block.body().transactions().is_empty() {
|
||||
// nothing to trace
|
||||
return Ok(Some(Vec::new()))
|
||||
}
|
||||
@ -350,7 +350,7 @@ pub trait Trace:
|
||||
// prepare transactions, we do everything upfront to reduce time spent with open
|
||||
// state
|
||||
let max_transactions =
|
||||
highest_index.map_or(block.body.transactions().len(), |highest| {
|
||||
highest_index.map_or(block.body().transactions().len(), |highest| {
|
||||
// we need + 1 because the index is 0-based
|
||||
highest as usize + 1
|
||||
});
|
||||
|
||||
@ -94,7 +94,7 @@ pub trait EthTransactions: LoadTransaction<Provider: BlockReaderIdExt> {
|
||||
self.cache()
|
||||
.get_sealed_block_with_senders(block)
|
||||
.await
|
||||
.map(|b| b.map(|b| b.body.transactions().to_vec()))
|
||||
.map(|b| b.map(|b| b.body().transactions().to_vec()))
|
||||
.map_err(Self::Error::from_eth_err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user