Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debug allStates implementation
Browse files Browse the repository at this point in the history
webmaster128 committed Dec 13, 2022
1 parent dea1f3c commit 0402b60
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/queries/ibc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toAscii } from '@cosmjs/encoding';
import { fromUtf8, toAscii } from '@cosmjs/encoding';
import {
createPagination,
createProtobufRpcClient,
@@ -465,12 +465,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,

0 comments on commit 0402b60

Please sign in to comment.