chore(consensus): Cut down on reth-primitives::TransactionSigned usage (#13659)

This commit is contained in:
DevOrbitlabs
2025-01-06 21:34:31 +07:00
committed by GitHub
parent 20d3fa6bbb
commit 923a805e1e
4 changed files with 13 additions and 1 deletions

View File

@ -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()