Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add ICQ test for new update period behaviour #NTRN-396 #350

Merged
merged 9 commits into from
Sep 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion 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,
pr0n00gler marked this conversation as resolved.
Show resolved Hide resolved
};
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];

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

Expand Down Expand Up @@ -462,8 +476,24 @@ 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);
expect(
queryResult.registered_query.last_submitted_result_local_height,
).lessThan(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
Loading