Skip to content

Commit

Permalink
chore(blockifier): simplify code in fn deploy_account_tx fn declare_tx
Browse files Browse the repository at this point in the history
  • Loading branch information
avivg-starkware committed Nov 12, 2024
1 parent e61c7ce commit 4bc4cf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 3 additions & 7 deletions crates/blockifier/src/test_utils/declare.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
use starknet_api::contract_class::ClassInfo;
use starknet_api::executable_transaction::{AccountTransaction as Transaction, DeclareTransaction};
use starknet_api::test_utils::declare::DeclareTxArgs;

use crate::transaction::account_transaction::AccountTransaction;

pub fn declare_tx(declare_tx_args: DeclareTxArgs, class_info: ClassInfo) -> AccountTransaction {
let tx_hash = declare_tx_args.tx_hash;
let declare_tx = starknet_api::test_utils::declare::declare_tx(declare_tx_args);
let declare_tx =
starknet_api::test_utils::declare::executable_declare_tx(declare_tx_args, class_info);

let executable_tx =
Transaction::Declare(DeclareTransaction { tx: declare_tx, tx_hash, class_info });

executable_tx.into()
declare_tx.into()
}
4 changes: 1 addition & 3 deletions crates/blockifier/src/test_utils/deploy_account.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use starknet_api::executable_transaction::AccountTransaction as Transaction;
use starknet_api::test_utils::deploy_account::DeployAccountTxArgs;
use starknet_api::test_utils::NonceManager;

Expand All @@ -12,7 +11,6 @@ pub fn deploy_account_tx(
deploy_tx_args,
nonce_manager,
);
let executable_tx = Transaction::DeployAccount(deploy_account_tx);

executable_tx.into()
deploy_account_tx.into()
}

0 comments on commit 4bc4cf0

Please sign in to comment.