Merge pull request #1183 from cosmos/unsubscribe-later

Make Tendermint 0.35 block header test independent of block count
This commit is contained in:
Simon Warta 2022-06-20 12:48:24 +02:00 committed by GitHub
commit 44013d9b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
});
@ -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);