From 39cc841e440d4e7fbe9242cd8c986ae217bc2c6a Mon Sep 17 00:00:00 2001 From: Arnon Hod Date: Thu, 22 Aug 2024 10:05:46 +0300 Subject: [PATCH] chore: move tx_hash getter near other getters in account tx (#542) --- .../src/transaction/account_transaction.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/blockifier/src/transaction/account_transaction.rs b/crates/blockifier/src/transaction/account_transaction.rs index 73a19e4425..fec8820e94 100644 --- a/crates/blockifier/src/transaction/account_transaction.rs +++ b/crates/blockifier/src/transaction/account_transaction.rs @@ -170,6 +170,14 @@ impl AccountTransaction { signature.0.len() } + pub fn tx_hash(&self) -> TransactionHash { + match self { + Self::Declare(tx) => tx.tx_hash(), + Self::DeployAccount(tx) => tx.tx_hash(), + Self::Invoke(tx) => tx.tx_hash(), + } + } + fn verify_tx_version(&self, version: TransactionVersion) -> TransactionExecutionResult<()> { let allowed_versions: Vec = match self { // Support `Declare` of version 0 in order to allow bootstrapping of a new system. @@ -667,14 +675,6 @@ impl AccountTransaction { self.run_revertible(state, tx_context, remaining_gas, validate, charge_fee) } - - pub fn tx_hash(&self) -> TransactionHash { - match self { - AccountTransaction::Declare(tx) => tx.tx_hash(), - AccountTransaction::DeployAccount(tx) => tx.tx_hash(), - AccountTransaction::Invoke(tx) => tx.tx_hash(), - } - } } impl ExecutableTransaction for AccountTransaction {