mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
stargate: Use assertDefined where appropriate
This commit is contained in:
parent
e2f5224d34
commit
d47e78cb8d
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user