diff --git a/packages/chopsticks/src/api.ts b/packages/chopsticks/src/api.ts index 89f1eeee..ba0912c7 100644 --- a/packages/chopsticks/src/api.ts +++ b/packages/chopsticks/src/api.ts @@ -103,16 +103,14 @@ export class Api { } async getStorage(key: string, hash?: string) { - if (hash) { - return this.#provider.send('state_getStorageAt', [key, hash]) - } - return this.#provider.send('state_getStorage', [key]) + const params = [key] + if (hash) params.push(hash) + return this.#provider.send('state_getStorage', params) } async getKeysPaged(prefix: string, pageSize: number, startKey: string, hash?: string) { - if (hash) { - return this.#provider.send('state_getKeysPagedAt', [prefix, pageSize, startKey, hash]) - } - return this.#provider.send('state_getKeysPaged', [prefix, pageSize, startKey]) + const params = [prefix, pageSize, startKey] + if (hash) params.push(hash) + return this.#provider.send('state_getKeysPaged', params) } } diff --git a/packages/chopsticks/src/genesis-provider.ts b/packages/chopsticks/src/genesis-provider.ts index 0eb02d73..e788e3b5 100644 --- a/packages/chopsticks/src/genesis-provider.ts +++ b/packages/chopsticks/src/genesis-provider.ts @@ -169,6 +169,7 @@ export class GenesisProvider implements ProviderInterface { return this.getBlock() case 'chain_getBlockHash': return this.blockHash + case 'state_getKeysPaged': case 'state_getKeysPagedAt': return [] case 'state_getStorage':