Skip to content

Commit

Permalink
chore(blockifier): use macro in AccounTx::{sender_address(), tx_hash()}
Browse files Browse the repository at this point in the history
  • Loading branch information
avivg-starkware committed Nov 27, 2024
1 parent a44a243 commit b9ab129
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions crates/blockifier/src/transaction/account_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ impl HasRelatedFeeType for AccountTransaction {
}

impl AccountTransaction {
implement_tx_getter_calls!((resource_bounds, ValidResourceBounds), (tip, Tip));
implement_tx_getter_calls!(
(resource_bounds, ValidResourceBounds),
(tip, Tip),
(sender_address, ContractAddress),
(tx_hash, TransactionHash)
);

implement_account_tx_inner_getters!(
(signature, TransactionSignature),
Expand All @@ -168,10 +173,6 @@ impl AccountTransaction {
AccountTransaction { tx, only_query: true }
}

pub fn sender_address(&self) -> ContractAddress {
self.tx.sender_address()
}

pub fn class_hash(&self) -> Option<ClassHash> {
match &self.tx {
Transaction::Declare(tx) => Some(tx.tx.class_hash()),
Expand Down Expand Up @@ -238,10 +239,6 @@ impl AccountTransaction {
self.signature().0.len()
}

pub fn tx_hash(&self) -> TransactionHash {
self.tx.tx_hash()
}

pub fn enforce_fee(&self) -> bool {
self.create_tx_info().enforce_fee()
}
Expand Down

0 comments on commit b9ab129

Please sign in to comment.