From 738d7da5fdfbd0524d2b71c2ac4c059d9f5601a3 Mon Sep 17 00:00:00 2001 From: Andreas Bigger Date: Mon, 28 Aug 2023 09:46:36 -0700 Subject: [PATCH 1/2] Fix nit to use signed tx helper method --- crates/primitives/src/transaction/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/primitives/src/transaction/mod.rs b/crates/primitives/src/transaction/mod.rs index 9c95bb04e290..5f80cc51e35a 100644 --- a/crates/primitives/src/transaction/mod.rs +++ b/crates/primitives/src/transaction/mod.rs @@ -552,6 +552,11 @@ impl Compact for Transaction { (Transaction::Eip1559(tx), buf) } 3 => { + // An identifier of 3 indicates that the transaction type did not fit into + // the backwards compatible 2 bit identifier, their transaction types are + // larger than 2 bits (eg. 4844 and Deposit Transactions). In this case, + // we need to read the concrete transaction type from the buffer by + // reading the full 8 bits (single byte) and match on this transaction type. let identifier = buf.get_u8() as usize; match identifier { 3 => { @@ -1179,10 +1184,7 @@ impl<'a> arbitrary::Arbitrary<'a> for TransactionSigned { signature }; - let mut tx = TransactionSigned { hash: Default::default(), signature, transaction }; - tx.hash = tx.recalculate_hash(); - - Ok(tx) + Ok(TransactionSigned::from_transaction_and_signature(transaction, signature)) } } From 4dfb9fa36273af25ad3c623874c198fc27f10767 Mon Sep 17 00:00:00 2001 From: Andreas Bigger Date: Mon, 28 Aug 2023 09:47:27 -0700 Subject: [PATCH 2/2] Fix nit to use signed tx helper method --- crates/primitives/src/transaction/mod.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/crates/primitives/src/transaction/mod.rs b/crates/primitives/src/transaction/mod.rs index 5f80cc51e35a..db7b49a9330e 100644 --- a/crates/primitives/src/transaction/mod.rs +++ b/crates/primitives/src/transaction/mod.rs @@ -552,11 +552,6 @@ impl Compact for Transaction { (Transaction::Eip1559(tx), buf) } 3 => { - // An identifier of 3 indicates that the transaction type did not fit into - // the backwards compatible 2 bit identifier, their transaction types are - // larger than 2 bits (eg. 4844 and Deposit Transactions). In this case, - // we need to read the concrete transaction type from the buffer by - // reading the full 8 bits (single byte) and match on this transaction type. let identifier = buf.get_u8() as usize; match identifier { 3 => {