Skip to content

Commit 37ad16a

Browse files
committed
chore: finish migration
1 parent 255467f commit 37ad16a

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

contracts/swap/src/queries.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ pub fn estimate_swap_result(
7272
current_swap.amount = swap_estimate.result_quantity;
7373
current_swap.denom = swap_estimate.result_denom;
7474

75-
deps.api.debug(&format!("step: {:?}", step));
76-
deps.api.debug(&format!("current_swap: {:?}", current_swap));
77-
7875
let step_fee = swap_estimate.fee_estimate.expect("fee estimate should be available");
7976

8077
fees.push(step_fee);
@@ -185,9 +182,6 @@ fn estimate_execution_buy_from_source(
185182
)));
186183
}
187184

188-
deps.api.debug(&format!("average_price: {average_price}"));
189-
deps.api.debug(&format!("result_quantity: {result_quantity}"));
190-
191185
Ok(StepExecutionEstimate {
192186
worst_price,
193187
result_quantity,
@@ -305,15 +299,10 @@ fn estimate_execution_sell_from_source(
305299
let average_price = get_average_price_from_orders(&top_orders, market.min_price_tick_size, false);
306300
let worst_price = get_worst_price_from_orders(&top_orders);
307301

308-
deps.api.debug(&format!("average_price: {average_price}"));
309-
deps.api.debug(&format!("input_base_quantity: {input_base_quantity}"));
310-
311302
let expected_exchange_quantity = input_base_quantity * average_price;
312303
let fee_estimate = expected_exchange_quantity * fee_percent;
313304
let expected_quantity = expected_exchange_quantity - fee_estimate;
314305

315-
deps.api.debug(&format!("input_base_quantity: {expected_exchange_quantity}"));
316-
317306
Ok(StepExecutionEstimate {
318307
worst_price,
319308
result_quantity: expected_quantity,

contracts/swap/src/testing/migration_test.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use injective_std::types::cosmwasm::wasm::v1::{MsgMigrateContract, MsgMigrateCon
1111
use injective_test_tube::{Account, ExecuteResponse, InjectiveTestApp, Module, Runner, Wasm};
1212
use injective_testing::test_tube::utils::store_code;
1313

14-
type V100InstantiateMsg = InstantiateMsg;
14+
type V101InstantiateMsg = InstantiateMsg;
1515

1616
#[test]
1717
#[cfg_attr(not(feature = "integration"), ignore)]
@@ -31,12 +31,12 @@ fn test_migration() {
3131
],
3232
);
3333

34-
let swap_v100_code_id = wasm.store_code(&wasm_byte_code, None, &owner).unwrap().data.code_id;
34+
let swap_v101_code_id = wasm.store_code(&wasm_byte_code, None, &owner).unwrap().data.code_id;
3535

36-
let swap_v100_address: String = wasm
36+
let swap_v101_address: String = wasm
3737
.instantiate(
38-
swap_v100_code_id,
39-
&V100InstantiateMsg {
38+
swap_v101_code_id,
39+
&V101InstantiateMsg {
4040
admin: Addr::unchecked(owner.address()),
4141
fee_recipient: FeeRecipient::SwapContract,
4242
},
@@ -53,14 +53,14 @@ fn test_migration() {
5353
.query(
5454
"/cosmwasm.wasm.v1.Query/ContractInfo",
5555
&QueryContractInfoRequest {
56-
address: swap_v100_address.clone(),
56+
address: swap_v101_address.clone(),
5757
},
5858
)
5959
.unwrap();
6060
let contract_info = res.contract_info.unwrap();
6161

62-
assert_eq!(res.address, swap_v100_address);
63-
assert_eq!(contract_info.code_id, swap_v100_code_id);
62+
assert_eq!(res.address, swap_v101_address);
63+
assert_eq!(contract_info.code_id, swap_v101_code_id);
6464
assert_eq!(contract_info.creator, owner.address());
6565
assert_eq!(contract_info.label, "swap-contract");
6666

@@ -70,7 +70,7 @@ fn test_migration() {
7070
.execute(
7171
MsgMigrateContract {
7272
sender: owner.address(),
73-
contract: swap_v100_address.clone(),
73+
contract: swap_v101_address.clone(),
7474
code_id: swap_v110_code_id,
7575
msg: serde_json_wasm::to_vec(&MigrateMsg {}).unwrap(),
7676
},
@@ -83,17 +83,17 @@ fn test_migration() {
8383
.query(
8484
"/cosmwasm.wasm.v1.Query/ContractInfo",
8585
&QueryContractInfoRequest {
86-
address: swap_v100_address.clone(),
86+
address: swap_v101_address.clone(),
8787
},
8888
)
8989
.unwrap();
9090

9191
let contract_info = res.contract_info.unwrap();
9292

93-
assert_eq!(res.address, swap_v100_address);
93+
assert_eq!(res.address, swap_v101_address);
9494
assert_eq!(contract_info.code_id, swap_v110_code_id);
9595
assert_eq!(contract_info.creator, owner.address());
9696
assert_eq!(contract_info.label, "swap-contract");
9797

98-
happy_path_two_hops_test(app, owner, swap_v100_address);
98+
happy_path_two_hops_test(app, owner, swap_v101_address);
9999
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)