Add future height test

This commit is contained in:
Simon Warta 2020-08-18 09:15:21 +02:00
parent b94d130c84
commit 9591c22512

View File

@ -178,6 +178,20 @@ function defaultTestSuite(rpcFactory: () => RpcClient, adaptor: Adaptor): void {
client.disconnect();
});
it("works with maxHeight in the future", async () => {
pendingWithoutTendermint();
const client = new Client(rpcFactory(), adaptor);
const height = (await client.status()).syncInfo.latestBlockHeight;
const blockchain = await client.blockchain(undefined, height + 20);
expect(blockchain.lastHeight).toEqual(height);
expect(blockchain.blockMetas.length).toBeGreaterThanOrEqual(2);
expect(blockchain.blockMetas[0].header.height).toEqual(height);
expect(blockchain.blockMetas[1].header.height).toEqual(height - 1);
client.disconnect();
});
it("can limit by minHeight and maxHeight", async () => {
pendingWithoutTendermint();
const client = new Client(rpcFactory(), adaptor);