Skip to content

Commit

Permalink
add ICQ test for new update period behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
joldie777 committed Sep 13, 2024
1 parent 9a4e55e commit 5ffd03f
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/testcases/run_in_band/interchain_kv_query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe('Neutron / Interchain KV Query', () => {
4: 3,
5: 4,
6: 11,
7: 50,
};
let testState: LocalState;
let neutronClient: SigningNeutronClient;
Expand Down Expand Up @@ -351,6 +352,19 @@ describe('Neutron / Interchain KV Query', () => {
testState.wallets.cosmos.val1.address,
);
});

test('register icq #7: balance', async () => {
const height = (await neutronClient.getHeight()) + updatePeriods[7]

Check failure on line 357 in src/testcases/run_in_band/interchain_kv_query.test.ts

View workflow job for this annotation

GitHub Actions / Actions - lint

Insert `;`

await registerBalancesQuery(
neutronClient,
contractAddress,
connectionId,
height,
[COSMOS_DENOM],
testState.wallets.cosmos.val1.address,
);
});
});
});

Expand Down Expand Up @@ -462,8 +476,22 @@ describe('Neutron / Interchain KV Query', () => {
);
});

test("registered icq #7 doesn't exist", async () => {
test('get registered icq #7: balance', async () => {
const queryId = 7;
const queryResult = await getRegisteredQuery(
neutronClient,
contractAddress,
queryId,
);

expect(queryResult.registered_query.last_submitted_result_local_height).greaterThan(0);

Check failure on line 487 in src/testcases/run_in_band/interchain_kv_query.test.ts

View workflow job for this annotation

GitHub Actions / Actions - lint

Replace `queryResult.registered_query.last_submitted_result_local_height` with `⏎········queryResult.registered_query.last_submitted_result_local_height,⏎······`
expect(queryResult.registered_query.last_submitted_result_local_height).lessThan(

Check failure on line 488 in src/testcases/run_in_band/interchain_kv_query.test.ts

View workflow job for this annotation

GitHub Actions / Actions - lint

Replace `queryResult.registered_query.last_submitted_result_local_height).lessThan(⏎········queryResult.registered_query.update_period,⏎······` with `⏎········queryResult.registered_query.last_submitted_result_local_height,⏎······).lessThan(queryResult.registered_query.update_period`
queryResult.registered_query.update_period,
);
});

test("registered icq #8 doesn't exist", async () => {
const queryId = 8;
await expect(
getRegisteredQuery(neutronClient, contractAddress, queryId),
).rejects.toThrow();
Expand Down Expand Up @@ -831,7 +859,7 @@ describe('Neutron / Interchain KV Query', () => {
async (response) =>
response.registered_query.last_submitted_result_local_height > 0 &&
response.registered_query.last_submitted_result_local_height + 5 <
(await neutronClient.getHeight()),
(await neutronClient.getHeight()),

Check failure on line 862 in src/testcases/run_in_band/interchain_kv_query.test.ts

View workflow job for this annotation

GitHub Actions / Actions - lint

Insert `··`
20,
);

Expand All @@ -858,7 +886,7 @@ describe('Neutron / Interchain KV Query', () => {
return (
balances[0].denom === beforeBalances[0].denom &&
parseInt(balances[0].amount || '0') >
parseInt(beforeBalances[0].amount || '0')
parseInt(beforeBalances[0].amount || '0')

Check failure on line 889 in src/testcases/run_in_band/interchain_kv_query.test.ts

View workflow job for this annotation

GitHub Actions / Actions - lint

Insert `··`
);
},

Expand Down

0 comments on commit 5ffd03f

Please sign in to comment.