From cc87eaf359a17aa747836dfb401bc3b3090eddda Mon Sep 17 00:00:00 2001 From: avivg-starkware Date: Wed, 27 Nov 2024 11:41:27 +0200 Subject: [PATCH] chore(blockifier): a simple code cleanup in signature_length() (#2108) --- .../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 {