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

@ -196,7 +196,7 @@ impl<T: Clone + Sync + Send + 'static> Stream for ForkChoiceStream<T> {
#[cfg(test)]
mod tests {
use super::*;
use alloy_primitives::B256;
use alloy_primitives::{b256, B256};
use reth_execution_types::ExecutionOutcome;
use reth_primitives::{Receipt, Receipts, TransactionSigned, TxType};
@ -332,7 +332,11 @@ mod tests {
block_receipts[0].0,
BlockReceipts {
block: block1.num_hash(),
tx_receipts: vec![(B256::default(), receipt1)]
tx_receipts: vec![(
// Transaction hash of a Transaction::default()
b256!("20b5378c6fe992c118b557d2f8e8bbe0b7567f6fe5483a8f0f1c51e93a9d91ab"),
receipt1
)]
}
);
@ -403,7 +407,11 @@ mod tests {
block_receipts[0].0,
BlockReceipts {
block: old_block1.num_hash(),
tx_receipts: vec![(B256::default(), old_receipt)]
tx_receipts: vec![(
// Transaction hash of a Transaction::default()
b256!("20b5378c6fe992c118b557d2f8e8bbe0b7567f6fe5483a8f0f1c51e93a9d91ab"),
old_receipt
)]
}
);
// Confirm this is from the reverted segment.
@ -415,7 +423,11 @@ mod tests {
block_receipts[1].0,
BlockReceipts {
block: new_block1.num_hash(),
tx_receipts: vec![(B256::default(), new_receipt)]
tx_receipts: vec![(
// Transaction hash of a Transaction::default()
b256!("20b5378c6fe992c118b557d2f8e8bbe0b7567f6fe5483a8f0f1c51e93a9d91ab"),
new_receipt
)]
}
);
// Confirm this is from the committed segment.