Skip to content

Commit

Permalink
more direct potential solution to undeterministic behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
eshelB committed Jun 15, 2023
1 parent b8202d2 commit 8588a12
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test/ibc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
createIbcChannel,
createIbcConnection,
loopRelayer,
passParameterChangeProposal,
passParameterChangeProposal, sleep,
turnIbcSwitchOff,
turnIbcSwitchOn,
waitForChainToStart,
Expand Down Expand Up @@ -420,13 +420,17 @@ describe("ibcResponses", () => {
}
expect(tx.code).toBe(TxResultCode.Success);

const readonly = new SecretNetworkClient({
chainId: "secretdev-1",
url: "http://localhost:1317",
});
const txs = await readonly.query.txsQuery(
`tx.hash='${tx.transactionHash}'`,
);
let txs: TxResponse[] = [];
let tries = 4;
while (txs?.length === 0 && tries > 0) {
// since this is immediately after tx broadcast,
// give some time for it to register in the node
await sleep(150);
txs = await secretjs.query.txsQuery(
`tx.hash='${tx.transactionHash}'`,
);
tries--;
}

expect(txs.length).toBe(1);
expect(txs[0].ibcResponses.length).toBe(0);
Expand Down

0 comments on commit 8588a12

Please sign in to comment.