Skip to content

Commit

Permalink
fix parallel tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Oct 17, 2024
1 parent 5b14abe commit d331926
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 196 deletions.
40 changes: 19 additions & 21 deletions src/helpers/interchainqueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,26 +511,24 @@ export const getRegisteredQuery = async (
contractAddress: string,
queryId: number,
): Promise<{
registered_query: {
id: number;
owner: string;
keys: {
path: string;
key: string;
}[];
query_type: string;
transactions_filter: string;
connection_id: string;
update_period: number;
last_submitted_result_local_height: number;
last_submitted_result_remote_height: {
revision_number: number;
revision_height: number;
};
deposit: { denom: string; amount: string }[];
submit_timeout: number;
registered_at_height: number;
id: number;
owner: string;
keys: {
path: string;
key: string;
}[];
query_type: string;
transactions_filter: string;
connection_id: string;
update_period: number;
last_submitted_result_local_height: number;
last_submitted_result_remote_height: {
revision_number: number;
revision_height: number;
};
deposit: { denom: string; amount: string }[];
submit_timeout: number;
registered_at_height: number;
}> =>
client.queryContractSmart(contractAddress, {
get_registered_query: {
Expand All @@ -549,7 +547,7 @@ export const waitForICQResultWithRemoteHeight = (
client,
() => getRegisteredQuery(client, contractAddress, queryId),
async (query) =>
query.registered_query.last_submitted_result_remote_height
query.last_submitted_result_remote_height
.revision_height >= targetHeight,
numAttempts,
);
Expand Down Expand Up @@ -581,7 +579,7 @@ export const waitForTransfersAmount = (
client,
async () =>
(await queryTransfersNumber(client, contractAddress)).transfers_number,
async (amount) => amount == expectedTransfersAmount,
async (amount) => amount.toString() == expectedTransfersAmount.toString(),
numAttempts,
);

Expand Down
14 changes: 7 additions & 7 deletions src/testcases/parallel/interchain_tx_query_resubmit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ describe('Neutron / Interchain TX Query Resubmit', () => {

test('check registered transfers query', async () => {
const query = await getRegisteredQuery(neutronClient, contractAddress, 1);
expect(query.registered_query.id).toEqual(1);
expect(query.registered_query.owner).toEqual(contractAddress);
expect(query.registered_query.keys.length).toEqual(0);
expect(query.registered_query.query_type).toEqual('tx');
expect(query.registered_query.transactions_filter).toEqual(
expect(query.id).toEqual('1');
expect(query.owner).toEqual(contractAddress);
expect(query.keys.length).toEqual(0);
expect(query.query_type).toEqual('tx');
expect(query.transactions_filter).toEqual(
'[{"field":"transfer.recipient","op":"Eq","value":"' +
watchedAddr1 +
'"}]',
);
expect(query.registered_query.connection_id).toEqual(connectionId);
expect(query.registered_query.update_period).toEqual(query1UpdatePeriod);
expect(query.connection_id).toEqual(connectionId);
expect(query.update_period).toEqual(query1UpdatePeriod.toString());
});

test('check failed txs', async () => {
Expand Down
Loading

0 comments on commit d331926

Please sign in to comment.