feat: convert hash field to OnceLock<TxHash> on TransactionSigned (#12596)

Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
This commit is contained in:
Steven
2024-11-21 16:40:29 -06:00
committed by GitHub
parent 6f6fb005ab
commit 4442b5d6fa
29 changed files with 127 additions and 87 deletions

View File

@ -628,7 +628,7 @@ pub trait Call: LoadState<Evm: ConfigureEvm<Header = Header>> + SpawnBlocking {
cfg.clone(),
block_env.clone(),
block_txs,
tx.hash,
tx.hash(),
)?;
let env = EnvWithHandlerCfg::new_with_cfg_env(

View File

@ -204,7 +204,7 @@ pub trait Trace: LoadState<Evm: ConfigureEvm<Header = Header>> {
cfg.clone(),
block_env.clone(),
block_txs,
tx.hash,
tx.hash(),
)?;
let env = EnvWithHandlerCfg::new_with_cfg_env(

View File

@ -107,7 +107,7 @@ where
let mut transactions = block.transactions_with_sender().enumerate().peekable();
let mut inspector = None;
while let Some((index, (signer, tx))) = transactions.next() {
let tx_hash = tx.hash;
let tx_hash = tx.hash();
let env = EnvWithHandlerCfg {
env: Env::boxed(
@ -255,7 +255,7 @@ where
cfg.clone(),
block_env.clone(),
block_txs,
tx.hash,
tx.hash(),
)?;
let env = EnvWithHandlerCfg {
@ -274,7 +274,7 @@ where
Some(TransactionContext {
block_hash: Some(block_hash),
tx_index: Some(index),
tx_hash: Some(tx.hash),
tx_hash: Some(tx.hash()),
}),
&mut None,
)

View File

@ -42,7 +42,7 @@ where
.enumerate()
.map(|(idx, (tx, receipt))| {
let meta = TransactionMeta {
tx_hash: tx.hash,
tx_hash: tx.hash(),
index: idx as u64,
block_hash,
block_number,

View File

@ -41,7 +41,8 @@ where
tx_info: TransactionInfo,
) -> Result<Self::Transaction, Self::Error> {
let from = tx.signer();
let TransactionSigned { transaction, signature, hash } = tx.into_signed();
let hash = tx.hash();
let TransactionSigned { transaction, signature, .. } = tx.into_signed();
let inner: TxEnvelope = match transaction {
reth_primitives::Transaction::Legacy(tx) => {