diff --git a/packages/stargate/src/modules/ibc/queries.spec.ts b/packages/stargate/src/modules/ibc/queries.spec.ts index 5c6e5449cb..5a425eed57 100644 --- a/packages/stargate/src/modules/ibc/queries.spec.ts +++ b/packages/stargate/src/modules/ibc/queries.spec.ts @@ -310,23 +310,14 @@ describe("IbcExtension", () => { }); describe("allStates", () => { - it("works", async () => { - pending("We cannot test this easily anymore since the IBC module was removed from simapp"); - const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl); + fit("works", async () => { + // pending("We cannot test this easily anymore since the IBC module was removed from simapp"); + const [client, tmClient] = await makeClientWithIbc("https://nois.rpc.bccnodes.com/"); - const response = await client.ibc.client.allStates(); - expect(response.clientStates).toEqual([ - { - clientId: ibcTest.clientId, - clientState: { - typeUrl: "/ibc.lightclients.tendermint.v1.ClientState", - value: jasmine.any(Uint8Array), - }, - }, - ]); + const _response = await client.ibc.client.allStates(); tmClient.disconnect(); - }); + }, 60_000); }); describe("consensusState", () => { diff --git a/packages/stargate/src/modules/ibc/queries.ts b/packages/stargate/src/modules/ibc/queries.ts index c4c2f43e19..0dbdb4f463 100644 --- a/packages/stargate/src/modules/ibc/queries.ts +++ b/packages/stargate/src/modules/ibc/queries.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { toAscii } from "@cosmjs/encoding"; +import { fromUtf8, toAscii } from "@cosmjs/encoding"; import { Uint64 } from "@cosmjs/math"; import { Any } from "cosmjs-types/google/protobuf/any"; import { @@ -363,12 +363,18 @@ export function setupIbcExtension(base: QueryClient): IbcExtension { const clientStates = []; let response: QueryClientStatesResponse; let key: Uint8Array | undefined; + let page = 1; do { response = await clientQueryService.ClientStates({ pagination: createPagination(key), }); clientStates.push(...response.clientStates); key = response.pagination?.nextKey; + console.log( + `Page ${page++}, response count ${response.clientStates.length}, next key: ${ + key ? fromUtf8(key, true) : undefined + }`, + ); } while (key && key.length); return { clientStates: clientStates,