Skip to content

Commit fb29651

Browse files
committed
fix: launch_spot_market_atom
chore: add launch_spot_market_custom_v2
1 parent ad2b508 commit fb29651

File tree

2 files changed

+40
-8
lines changed
  • contracts/injective-cosmwasm-mock/src
  • packages/injective-testing/src/test_tube

2 files changed

+40
-8
lines changed

contracts/injective-cosmwasm-mock/src/utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ impl Setup {
102102
.unwrap();
103103
send(&Bank::new(&app), "1000000000000000000000", BASE_DENOM, &owner, &validator);
104104
add_denom_notional_and_decimal(&app, &validator, QUOTE_DENOM.to_string(), "1".to_string(), QUOTE_DECIMALS as u64);
105-
106105
add_denom_notional_and_decimal(&app, &validator, BASE_DENOM.to_string(), "1".to_string(), BASE_DECIMALS as u64);
107106
let mut users: Vec<UserInfo> = Vec::new();
108107

packages/injective-testing/src/test_tube/exchange.rs

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,13 @@ pub fn launch_spot_market_atom(exchange: &Exchange<InjectiveTestApp>, signer: &S
530530
.instant_spot_market_launch_v2(
531531
v2::MsgInstantSpotMarketLaunch {
532532
sender: signer.address(),
533-
ticker: "INJ/USDT".to_owned(),
534-
base_denom: "inj".to_owned(),
535-
quote_denom: "usdt".to_owned(),
533+
ticker: "ATOM/USDT".to_owned(),
534+
base_denom: MOCK_ATOM_DENOM.to_owned(),
535+
quote_denom: MOCK_QUOTE_DENOM.to_owned(),
536536
min_price_tick_size: dec_to_proto(FPDecimal::must_from_str("0.000010000000000000")),
537537
min_quantity_tick_size: dec_to_proto(FPDecimal::must_from_str("100000")),
538538
min_notional: dec_to_proto(FPDecimal::must_from_str("1")),
539-
base_decimals: MOCK_BASE_DECIMALS as u32,
539+
base_decimals: MOCK_ATOM_DECIMALS as u32,
540540
quote_decimals: MOCK_QUOTE_DECIMALS as u32,
541541
},
542542
signer,
@@ -575,6 +575,39 @@ pub fn launch_spot_market_custom(
575575
get_spot_market_id(exchange, ticker)
576576
}
577577

578+
pub fn launch_spot_market_custom_v2(
579+
exchange: &Exchange<InjectiveTestApp>,
580+
signer: &SigningAccount,
581+
ticker: String,
582+
base_denom: String,
583+
quote_denom: String,
584+
min_price_tick_size: String,
585+
min_quantity_tick_size: String,
586+
base_decimals: u32,
587+
quote_decimals: u32,
588+
) -> String {
589+
exchange
590+
.instant_spot_market_launch_v2(
591+
v2::MsgInstantSpotMarketLaunch {
592+
sender: signer.address(),
593+
ticker: ticker.clone(),
594+
base_denom,
595+
quote_denom,
596+
min_price_tick_size: dec_to_proto(FPDecimal::must_from_str(&min_price_tick_size)),
597+
min_quantity_tick_size: dec_to_proto(FPDecimal::must_from_str(&min_quantity_tick_size)),
598+
min_notional: dec_to_proto(FPDecimal::must_from_str("1")),
599+
base_decimals,
600+
quote_decimals,
601+
},
602+
signer,
603+
)
604+
.unwrap();
605+
606+
get_spot_market_id(exchange, ticker)
607+
}
608+
609+
610+
578611
pub fn launch_perp_market(exchange: &Exchange<InjectiveTestApp>, signer: &SigningAccount, ticker: String) -> String {
579612
exchange
580613
.instant_perpetual_market_launch_v2(
@@ -608,9 +641,9 @@ pub fn launch_perp_market_atom(exchange: &Exchange<InjectiveTestApp>, signer: &S
608641
v2::MsgInstantPerpetualMarketLaunch {
609642
sender: signer.address(),
610643
ticker: ticker.to_owned(),
611-
quote_denom: "usdt".to_string(),
612-
oracle_base: "atom".to_string(),
613-
oracle_quote: "usdt".to_string(),
644+
quote_denom: MOCK_QUOTE_DENOM.to_owned(),
645+
oracle_base: MOCK_ATOM_DENOM.to_owned(),
646+
oracle_quote: MOCK_QUOTE_DENOM.to_owned(),
614647
oracle_scale_factor: 6u32,
615648
oracle_type: 2i32,
616649
maker_fee_rate: "-000100000000000000".to_owned(),

0 commit comments

Comments
 (0)