From 879a733b5bfa934299a16b7505ece45383695aaa Mon Sep 17 00:00:00 2001 From: willclarktech Date: Wed, 9 Dec 2020 14:51:18 +0000 Subject: [PATCH] stargate: Fix comparison operator --- packages/stargate/src/queries/queryclient.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/stargate/src/queries/queryclient.ts b/packages/stargate/src/queries/queryclient.ts index 8629037f..31cf9ef1 100644 --- a/packages/stargate/src/queries/queryclient.ts +++ b/packages/stargate/src/queries/queryclient.ts @@ -3,7 +3,7 @@ import { iavlSpec, ics23, tendermintSpec, verifyExistence, verifyNonExistence } import { toAscii, toHex } from "@cosmjs/encoding"; import { firstEvent } from "@cosmjs/stream"; import { Client as TendermintClient, Header, NewBlockHeaderEvent, ProofOp } from "@cosmjs/tendermint-rpc"; -import { arrayContentEquals, assert, isNonNullObject, sleep } from "@cosmjs/utils"; +import { arrayContentEquals, assert, assertDefined, isNonNullObject, sleep } from "@cosmjs/utils"; import { Stream } from "xstream"; type QueryExtensionSetup

= (base: QueryClient) => P; @@ -233,8 +233,8 @@ export class QueryClient { // this must return the header for height+1 // throws an error if height is 0 or undefined private async getNextHeader(height?: number): Promise

{ - assert(height); - if (height == 0) { + assertDefined(height); + if (height === 0) { throw new Error("Query returned height 0, cannot prove it"); }