Skip to content

Commit

Permalink
refactor: move deploy_account_tx next to peers (#458)
Browse files Browse the repository at this point in the history
Moved next to similar constructors `invoke_tx()` and `declare_tx()`.

NOTE: Only move, no internal changes.

Co-Authored-By: Gilad Chase <[email protected]>
  • Loading branch information
giladchase and Gilad Chase authored Jul 14, 2024
1 parent 7cf243c commit b1804bb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions crates/mempool_test_utils/src/starknet_api_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ pub fn invoke_tx(cairo_version: CairoVersion) -> RPCTransaction {
.generate_default_invoke()
}

// TODO(Yael 18/6/2024): Get a final decision from product whether to support Cairo0.
pub fn deploy_account_tx() -> RPCTransaction {
let default_account = FeatureContract::AccountWithoutValidations(CairoVersion::Cairo1);

MultiAccountTransactionGenerator::new_for_account_contracts([default_account])
.account_with_id(0)
.generate_default_deploy_account()
}

// TODO: when moving this to Starknet API crate, move this const into a module alongside
// MultiAcconutTransactionGenerator.
type AccountId = u16;
Expand Down Expand Up @@ -472,15 +481,6 @@ pub fn external_tx_to_json(tx: &RPCTransaction) -> String {
to_string_pretty(&tx_json).expect("Failed to serialize transaction")
}

// TODO(Yael 18/6/2024): Get a final decision from product whether to support Cairo0.
pub fn deploy_account_tx() -> RPCTransaction {
let default_account = FeatureContract::AccountWithoutValidations(CairoVersion::Cairo1);

MultiAccountTransactionGenerator::new_for_account_contracts([default_account])
.account_with_id(0)
.generate_default_deploy_account()
}

pub fn deployed_account_contract_address(deploy_tx: &RPCTransaction) -> ContractAddress {
let tx = assert_matches!(
deploy_tx,
Expand Down

0 comments on commit b1804bb

Please sign in to comment.