Skip to content

Commit

Permalink
fix activate_z_coin_*
Browse files Browse the repository at this point in the history
naming was used loosely, pirate was used as if it was zombie, a previous
fix in the url constants led to this breaking.
  • Loading branch information
mariocynicys committed Nov 1, 2024
1 parent 6a700f7 commit 39fa8b1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
42 changes: 21 additions & 21 deletions mm2src/mm2_main/tests/mm2_tests/z_coin_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use std::str::FromStr;
use std::thread;
use std::time::Duration;

const ZOMBIE_TEST_BIP39_ACTIVATION_SEED: &str = "course flock lucky cereal hamster novel team never metal bean behind cute cruel matrix symptom fault harsh fashion impact prison glove then tree chef";
const ZOMBIE_TEST_BALANCE_SEED: &str = "zombie test seed";
const ARRR_TEST_BIP39_ACTIVATION_SEED: &str = "course flock lucky cereal hamster novel team never metal bean behind cute cruel matrix symptom fault harsh fashion impact prison glove then tree chef";
const ARRR_TEST_BALANCE_SEED: &str = "zombie test seed";
const ARRR_TEST_ACTIVATION_SEED: &str = "arrr test activation seed";
const ZOMBIE_TEST_HISTORY_SEED: &str = "zombie test history seed";
const ZOMBIE_TEST_WITHDRAW_SEED: &str = "zombie withdraw test seed";
Expand Down Expand Up @@ -48,16 +48,16 @@ async fn withdraw(mm: &MarketMakerIt, coin: &str, to: &str, amount: &str) -> Tra

#[test]
fn activate_z_coin_light() {
let coins = json!([zombie_conf()]);
let coins = json!([pirate_conf()]);

let conf = Mm2TestConf::seednode(ZOMBIE_TEST_BALANCE_SEED, &coins);
let conf = Mm2TestConf::seednode(ARRR_TEST_BALANCE_SEED, &coins);
let mm = MarketMakerIt::start(conf.conf, conf.rpc_password, None).unwrap();

let activation_result = block_on(enable_z_coin_light(
&mm,
ZOMBIE_TICKER,
ZOMBIE_ELECTRUMS,
ZOMBIE_LIGHTWALLETD_URLS,
ARRR,
PIRATE_ELECTRUMS,
PIRATE_LIGHTWALLETD_URLS,
None,
None,
));
Expand All @@ -71,16 +71,16 @@ fn activate_z_coin_light() {

#[test]
fn activate_z_coin_light_with_changing_height() {
let coins = json!([zombie_conf()]);
let coins = json!([pirate_conf()]);

let conf = Mm2TestConf::seednode_with_hd_account(ZOMBIE_TEST_BIP39_ACTIVATION_SEED, &coins);
let conf = Mm2TestConf::seednode_with_hd_account(ARRR_TEST_BIP39_ACTIVATION_SEED, &coins);
let mm = MarketMakerIt::start(conf.conf, conf.rpc_password, None).unwrap();

let activation_result = block_on(enable_z_coin_light(
&mm,
ZOMBIE_TICKER,
ZOMBIE_ELECTRUMS,
ZOMBIE_LIGHTWALLETD_URLS,
ARRR,
PIRATE_ELECTRUMS,
PIRATE_LIGHTWALLETD_URLS,
None,
None,
));
Expand All @@ -93,7 +93,7 @@ fn activate_z_coin_light_with_changing_height() {
assert_eq!(balance.balance.spendable, BigDecimal::default());

// disable coin
block_on(disable_coin(&mm, ZOMBIE_TICKER, true));
block_on(disable_coin(&mm, ARRR, true));

// Perform activation with changed height
// Calculate timestamp for 2 days ago
Expand All @@ -106,9 +106,9 @@ fn activate_z_coin_light_with_changing_height() {

let activation_result = block_on(enable_z_coin_light(
&mm,
ZOMBIE_TICKER,
ZOMBIE_ELECTRUMS,
ZOMBIE_LIGHTWALLETD_URLS,
ARRR,
PIRATE_ELECTRUMS,
PIRATE_LIGHTWALLETD_URLS,
None,
Some(two_days_ago),
));
Expand All @@ -132,17 +132,17 @@ fn activate_z_coin_light_with_changing_height() {

#[test]
fn activate_z_coin_with_hd_account() {
let coins = json!([zombie_conf()]);
let coins = json!([pirate_conf()]);

let hd_account_id = 0;
let conf = Mm2TestConf::seednode_with_hd_account(ZOMBIE_TEST_BIP39_ACTIVATION_SEED, &coins);
let conf = Mm2TestConf::seednode_with_hd_account(ARRR_TEST_BIP39_ACTIVATION_SEED, &coins);
let mm = MarketMakerIt::start(conf.conf, conf.rpc_password, None).unwrap();

let activation_result = block_on(enable_z_coin_light(
&mm,
ZOMBIE_TICKER,
ZOMBIE_ELECTRUMS,
ZOMBIE_LIGHTWALLETD_URLS,
ARRR,
PIRATE_ELECTRUMS,
PIRATE_LIGHTWALLETD_URLS,
Some(hd_account_id),
None,
));
Expand Down
4 changes: 3 additions & 1 deletion mm2src/mm2_test_helpers/src/for_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,11 @@ pub fn pirate_conf() -> Json {
"b58_pubkey_address_prefix": [ 28, 184 ],
"b58_script_address_prefix": [ 28, 189 ]
},
"z_derivation_path": "m/32'/133'",
}
},
"required_confirmations":0
"required_confirmations":0,
"derivation_path": "m/44'/133'",
})
}

Expand Down

0 comments on commit 39fa8b1

Please sign in to comment.