Skip to content

Commit

Permalink
Merge branch 'main' into test-double-ack
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/testcases/run_in_band/interchaintx.test.ts
  • Loading branch information
NeverHappened committed Jul 28, 2023
2 parents b0cbbc6 + 5e29d65 commit a0219ce
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions src/testcases/run_in_band/interchaintx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,13 @@ describe('Neutron / Interchain TXs', () => {
}),
);

await neutronChain.blockWaiter.waitBlocks(10);
// wait until sudo is called and processed and failure is recorder
await getWithAttempts<AckFailuresResponse>(
neutronChain.blockWaiter,
async () => neutronChain.queryAckFailures(contractAddress),
async (data) => data.failures.length == 1,
100,
);

// make sure contract's state hasn't been changed
const acks = await getAcks(neutronChain, contractAddress);
Expand Down Expand Up @@ -674,7 +680,13 @@ describe('Neutron / Interchain TXs', () => {
}),
);

await neutronChain.blockWaiter.waitBlocks(10);
// wait until sudo is called and processed and failure is recorder
await getWithAttempts<AckFailuresResponse>(
neutronChain.blockWaiter,
async () => neutronChain.queryAckFailures(contractAddress),
async (data) => data.failures.length == 2,
100,
);

// make sure contract's state hasn't been changed
const acks = await getAcks(neutronChain, contractAddress);
Expand Down Expand Up @@ -711,7 +723,13 @@ describe('Neutron / Interchain TXs', () => {
}),
);

await neutronChain.blockWaiter.waitBlocks(10);
// wait until sudo is called and processed and failure is recorder
await getWithAttempts<AckFailuresResponse>(
neutronChain.blockWaiter,
async () => neutronChain.queryAckFailures(contractAddress),
async (data) => data.failures.length == 3,
100,
);

// make sure contract's state hasn't been changed
const acks = await getAcks(neutronChain, contractAddress);
Expand Down Expand Up @@ -749,7 +767,13 @@ describe('Neutron / Interchain TXs', () => {
}),
);

await neutronChain.blockWaiter.waitBlocks(20);
// wait until sudo is called and processed and failure is recorder
await getWithAttempts<AckFailuresResponse>(
neutronChain.blockWaiter,
async () => neutronChain.queryAckFailures(contractAddress),
async (data) => data.failures.length == 4,
100,
);

// make sure contract's state hasn't been changed
const acks = await getAcks(neutronChain, contractAddress);
Expand All @@ -765,12 +789,7 @@ describe('Neutron / Interchain TXs', () => {
});

test('check stored failures and acks', async () => {
const failures = await getWithAttempts<AckFailuresResponse>(
neutronChain.blockWaiter,
async () => neutronChain.queryAckFailures(contractAddress),
async (data) => data.failures.length == 4,
100,
);
const failures = await neutronChain.queryAckFailures(contractAddress);
// 3 ack failures, 1 timeout failure, just as described in the tests above
expect(failures.failures).toEqual([
{
Expand Down

0 comments on commit a0219ce

Please sign in to comment.