From 8b701d7f8a7cd370017c9dcd4ee940a0a977d9a0 Mon Sep 17 00:00:00 2001 From: Aviv Greenburg Date: Sun, 17 Nov 2024 14:23:32 +0200 Subject: [PATCH] chore(blockifier): a simple code cleanup in signature_length() --- .../blockifier/src/transaction/account_transaction.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/crates/blockifier/src/transaction/account_transaction.rs b/crates/blockifier/src/transaction/account_transaction.rs index 479e2d78e7..2a5ba98c27 100644 --- a/crates/blockifier/src/transaction/account_transaction.rs +++ b/crates/blockifier/src/transaction/account_transaction.rs @@ -88,7 +88,7 @@ pub struct AccountTransaction { pub tx: Transaction, only_query: bool, } - +// TODO(AvivG): create additional macro that returns a reference. macro_rules! implement_account_tx_inner_getters { ($(($field:ident, $field_type:ty)),*) => { $(pub fn $field(&self) -> $field_type { @@ -227,13 +227,7 @@ impl AccountTransaction { } pub fn signature_length(&self) -> usize { - let signature = match &self.tx { - Transaction::Declare(tx) => tx.signature(), - Transaction::DeployAccount(tx) => tx.signature(), - Transaction::Invoke(tx) => tx.signature(), - }; - - signature.0.len() + self.signature().0.len() } pub fn tx_hash(&self) -> TransactionHash {