diff --git a/packages/stargate/src/queries/queryclient.ts b/packages/stargate/src/queries/queryclient.ts index 31cf9ef1e6..f9d636cd2c 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, assertDefined, isNonNullObject, sleep } from "@cosmjs/utils"; +import { arrayContentEquals, assert, assertDefinedAndNotNull, isNonNullObject, sleep } from "@cosmjs/utils"; import { Stream } from "xstream"; type QueryExtensionSetup

= (base: QueryClient) => P; @@ -233,7 +233,7 @@ 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

{ - assertDefined(height); + assertDefinedAndNotNull(height); if (height === 0) { throw new Error("Query returned height 0, cannot prove it"); } diff --git a/packages/stargate/src/stargateclient.ts b/packages/stargate/src/stargateclient.ts index 9d2304bf2a..488ff28569 100644 --- a/packages/stargate/src/stargateclient.ts +++ b/packages/stargate/src/stargateclient.ts @@ -18,7 +18,7 @@ import { Client as TendermintClient, DateTime, } from "@cosmjs/tendermint-rpc"; -import { assert, assertDefined } from "@cosmjs/utils"; +import { assert, assertDefinedAndNotNull } from "@cosmjs/utils"; import Long from "long"; import { cosmos } from "./codec"; @@ -110,10 +110,8 @@ export function accountFromProto(input: IBaseAccount): Account { } export function coinFromProto(input: ICoin): Coin { - assertDefined(input.amount); - assertDefined(input.denom); - assert(input.amount !== null); - assert(input.denom !== null); + assertDefinedAndNotNull(input.amount); + assertDefinedAndNotNull(input.denom); return { amount: input.amount, denom: input.denom,