stargate: Use assertDefined where appropriate

This commit is contained in:
willclarktech 2021-01-14 13:29:22 +00:00
parent e2f5224d34
commit d47e78cb8d
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7

View File

@ -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, assertDefinedAndNotNull, isNonNullObject, sleep } from "@cosmjs/utils";
import { arrayContentEquals, assert, assertDefined, isNonNullObject, sleep } from "@cosmjs/utils";
import { Stream } from "xstream";
type QueryExtensionSetup<P> = (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<Header> {
assertDefinedAndNotNull(height);
assertDefined(height);
if (height === 0) {
throw new Error("Query returned height 0, cannot prove it");
}