Skip to content

Commit

Permalink
remove bindings tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcompagni10 committed Sep 4, 2024
1 parent 46a1486 commit da7e522
Showing 1 changed file with 0 additions and 135 deletions.
135 changes: 0 additions & 135 deletions src/testcases/run_in_band/dex_bindings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,19 +464,6 @@ describe('Neutron / dex module bindings', () => {
['TrancheKey'],
)[0]['TrancheKey'];

// swap through a bit of it
await neutronClient.execute(contractAddress, {
place_limit_order: {
receiver: contractAddress,
token_in: 'uibcusdc',
token_out: 'untrn',
tick_index_in_to_out: 0,
limit_sell_price: '1',
amount_in: '1000',
order_type: 'IMMEDIATE_OR_CANCEL',
},
});

// create an expired tranche
const res2 = await neutronClient.execute(contractAddress, {
place_limit_order: {
Expand Down Expand Up @@ -669,127 +656,5 @@ describe('Neutron / dex module bindings', () => {
});
expect(res.pool_metadata.length).toBeGreaterThan(0);
});
test('SimulateDeposit', async () => {
const res = await neutronClient.queryContractSmart(contractAddress, {
simulate_deposit: {
msg: {
token_a: 'untrn',
token_b: 'uibcusdc',
amounts_a: ['100'],
amounts_b: ['0'],
tick_indexes_a_to_b: [0],
fees: [1],
options: [{ disable_autoswap: true, fail_tx_on_bel: false }],
},
},
});
expect(res.resp.reserve0_deposited[0]).toBe('0');
expect(res.resp.reserve1_deposited[0]).toBe('100');
expect(res.resp.shares_issued[0].amount).toBe('100');
});
test('SimulateDeposit failed deposit', async () => {
const res = await neutronClient.queryContractSmart(contractAddress, {
simulate_deposit: {
msg: {
token_a: 'untrn',
token_b: 'uibcusdc',
amounts_a: ['0'],
amounts_b: ['100'],
tick_indexes_a_to_b: [0],
fees: [1],
options: [{ disable_autoswap: true, fail_tx_on_bel: false }],
},
},
});
expect(res.resp.failed_deposits[0].error).contains('deposit failed');
});
test('SimulateWithdrawal', async () => {
const res = await neutronClient.queryContractSmart(contractAddress, {
simulate_withdrawal: {
msg: {
creator: contractAddress,
receiver: contractAddress,
token_a: 'untrn',
token_b: 'uibcusdc',
shares_to_remove: ['10'],
tick_indexes_a_to_b: [1],
fees: [0],
},
},
});
expect(res.resp.reserve1_withdrawn).toBe('10');
expect(res.resp.shares_burned[0].amount).toBe('10');
});
test('SimulatePlaceLimitOrder', async () => {
const res = await neutronClient.queryContractSmart(contractAddress, {
simulate_place_limit_order: {
msg: {
token_in: 'uibcusdc',
token_out: 'untrn',
tick_index_in_to_out: 0,
limit_sell_price: '1.2',
amount_in: '10000',
order_type: 'FILL_OR_KILL',
},
},
});
expect(res.resp.taker_coin_out.amount).toBe('12212');
expect(res.resp.taker_coin_in.amount).toBe('10000');
expect(res.resp.coin_in.amount).toBe('10000');
}),
test('SimulateWithdrawFilledLimitOrder', async () => {
const res = await neutronClient.queryContractSmart(contractAddress, {
simulate_withdraw_filled_limit_order: {
msg: {
creator: contractAddress,
tranche_key: activeTrancheKey,
},
},
});
expect(res.resp.taker_coin_out.amount).toBe('998');
expect(res.resp.maker_coin_out.amount).toBe('0');
});
test('SimulateCancelLimitOrder', async () => {
const res = await neutronClient.queryContractSmart(contractAddress, {
simulate_cancel_limit_order: {
msg: {
creator: contractAddress,
tranche_key: activeTrancheKey,
},
},
});
expect(res.resp.taker_coin_out.amount).toBe('998');
expect(res.resp.maker_coin_out.amount).toBe('998779');
});
test('SimulateMultiHopSwap', async () => {
const res = await neutronClient.queryContractSmart(contractAddress, {
simulate_multi_hop_swap: {
msg: {
receiver: contractAddress,
routes: [
{
hops: [
multiHopSwapDenoms[0].denom,
multiHopSwapDenoms[1].denom,
multiHopSwapDenoms[2].denom,
multiHopSwapDenoms[3].denom,
multiHopSwapDenoms[4].denom,
multiHopSwapDenoms[5].denom,
multiHopSwapDenoms[6].denom,
multiHopSwapDenoms[7].denom,
multiHopSwapDenoms[8].denom,
multiHopSwapDenoms[9].denom,
],
},
],
amount_in: '100',
exit_limit_price: '0.1',
pick_best_route: true,
},
},
});
expect(res.resp.coin_out.amount).toBe('91');
expect(res.resp.route.hops.length).toBe(10);
});
});
});

0 comments on commit da7e522

Please sign in to comment.