mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
dev: block_with_senders on BlockState (#11363)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -11,8 +11,8 @@ use reth_chainspec::ChainInfo;
|
||||
use reth_execution_types::{Chain, ExecutionOutcome};
|
||||
use reth_metrics::{metrics::Gauge, Metrics};
|
||||
use reth_primitives::{
|
||||
Header, Receipt, Receipts, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta,
|
||||
TransactionSigned,
|
||||
BlockWithSenders, Header, Receipt, Receipts, SealedBlock, SealedBlockWithSenders, SealedHeader,
|
||||
TransactionMeta, TransactionSigned,
|
||||
};
|
||||
use reth_storage_api::StateProviderBox;
|
||||
use reth_trie::{updates::TrieUpdates, HashedPostState};
|
||||
@ -618,6 +618,20 @@ impl BlockState {
|
||||
self.block.clone()
|
||||
}
|
||||
|
||||
/// Returns the block with senders for the state.
|
||||
pub fn block_with_senders(&self) -> BlockWithSenders {
|
||||
let block = self.block.block().clone();
|
||||
let senders = self.block.senders().clone();
|
||||
BlockWithSenders { block: block.unseal(), senders }
|
||||
}
|
||||
|
||||
/// Returns the sealed block with senders for the state.
|
||||
pub fn sealed_block_with_senders(&self) -> SealedBlockWithSenders {
|
||||
let block = self.block.block().clone();
|
||||
let senders = self.block.senders().clone();
|
||||
SealedBlockWithSenders { block, senders }
|
||||
}
|
||||
|
||||
/// Returns the hash of executed block that determines the state.
|
||||
pub fn hash(&self) -> B256 {
|
||||
self.block.block().hash()
|
||||
|
||||
Reference in New Issue
Block a user