Skip to content

Commit

Permalink
Merge pull request #1183 from cosmos/unsubscribe-later
Browse files Browse the repository at this point in the history
Make Tendermint 0.35 block header test independent of block count
  • Loading branch information
webmaster128 authored Jun 20, 2022
2 parents 42e39f9 + e3e2b81 commit 44013d9
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,6 @@ function websocketTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValue
expect(event.header.validatorsHash).toBeTruthy();

events.push(event);

if (events.length === 3) {
subscription.unsubscribe();
}
},
error: fail,
});
Expand All @@ -662,6 +658,9 @@ function websocketTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValue
// wait for events to be processed
await sleep(100);

// Stop listening for new blocks
subscription.unsubscribe();

// We don't know exactly in which block the transactions are added. So we look into those
// with txs.
const eventsWithTx = events.filter((e) => e.txs.length > 0);
Expand Down

0 comments on commit 44013d9

Please sign in to comment.