mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(consensus): Cut down on reth-primitives::TransactionSigned usage (#13659)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -6923,6 +6923,7 @@ dependencies = [
|
||||
"rand 0.8.5",
|
||||
"reth-chainspec",
|
||||
"reth-consensus",
|
||||
"reth-ethereum-primitives",
|
||||
"reth-primitives",
|
||||
"reth-primitives-traits",
|
||||
"reth-storage-api",
|
||||
|
||||
@ -25,6 +25,7 @@ alloy-eips.workspace = true
|
||||
[dev-dependencies]
|
||||
alloy-consensus.workspace = true
|
||||
reth-storage-api.workspace = true
|
||||
reth-ethereum-primitives.workspace = true
|
||||
rand.workspace = true
|
||||
mockall = "0.13"
|
||||
|
||||
|
||||
@ -347,7 +347,8 @@ mod tests {
|
||||
use mockall::mock;
|
||||
use rand::Rng;
|
||||
use reth_chainspec::ChainSpecBuilder;
|
||||
use reth_primitives::{proofs, Account, BlockBody, Transaction, TransactionSigned};
|
||||
use reth_ethereum_primitives::{Transaction, TransactionSigned};
|
||||
use reth_primitives::{proofs, Account, BlockBody};
|
||||
use reth_storage_api::{
|
||||
errors::provider::ProviderResult, AccountReader, HeaderProvider, WithdrawalsProvider,
|
||||
};
|
||||
|
||||
@ -290,6 +290,15 @@ impl PartialEq for TransactionSigned {
|
||||
}
|
||||
}
|
||||
|
||||
impl TransactionSigned {
|
||||
/// Creates a new signed transaction from the given transaction and signature without the hash.
|
||||
///
|
||||
/// Note: this only calculates the hash on the first [`TransactionSigned::hash`] call.
|
||||
pub fn new_unhashed(transaction: Transaction, signature: Signature) -> Self {
|
||||
Self { hash: Default::default(), signature, transaction }
|
||||
}
|
||||
}
|
||||
|
||||
impl Typed2718 for TransactionSigned {
|
||||
fn ty(&self) -> u8 {
|
||||
self.transaction.ty()
|
||||
|
||||
Reference in New Issue
Block a user