Skip to content

Commit

Permalink
chore: move tx_hash getter near other getters in account tx (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware authored Aug 22, 2024
1 parent df519dc commit 39cc841
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/blockifier/src/transaction/account_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TransactionVersion> = match self {
// Support `Declare` of version 0 in order to allow bootstrapping of a new system.
Expand Down Expand Up @@ -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<U: UpdatableState> ExecutableTransaction<U> for AccountTransaction {
Expand Down

0 comments on commit 39cc841

Please sign in to comment.