polkadot-js / api

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata.
Apache License 2.0
1.07k stars 350 forks source link

Unable to decode type #4625

Closed sushi30 closed 2 years ago

sushi30 commented 2 years ago

I am trying to run the an API call against a Shiden (Kusama) node. Hitting this error regarding decoding. The types match the definition in the pallet.

  ~/dev/astar-js-demo on   master ❯ ts-node index.ts                                                                                                   at  14:06:32
2022-03-03 14:06:40        API/INIT: RPC methods not decorated: eth_feeHistory
{ version: '336' }
2022-03-03 14:06:41        RPC-CORE: getStorage(key: StorageKey, at?: BlockHash): StorageData:: Unable to decode storage dappsStaking.contractEraStake:: createType(PalletDappsStakingEraStakingPoints):: decodeU8a: failed at 0xd38515e62f83f804861803773ae17af0… on stakers: BTreeMap<AccountId,Balance>:: Number can only safely store up to 53 bits
/home/imri/dev/astar-js-demo/node_modules/@polkadot/rpc-core/bundle.cjs:477
      throw new Error(`Unable to decode storage ${key.section || 'unknown'}.${key.method || 'unknown'}:${entryNum}: ${error.message}`);
            ^
Error: Unable to decode storage dappsStaking.contractEraStake:: createType(PalletDappsStakingEraStakingPoints):: decodeU8a: failed at 0xd38515e62f83f804861803773ae17af0… on stakers: BTreeMap<AccountId,Balance>:: Number can only safely store up to 53 bits
    at RpcCore._newType (/home/imri/dev/astar-js-demo/node_modules/@polkadot/rpc-core/bundle.cjs:477:13)
    at RpcCore._formatStorageData (/home/imri/dev/astar-js-demo/node_modules/@polkadot/rpc-core/bundle.cjs:422:17)
    at RpcCore._formatOutput (/home/imri/dev/astar-js-demo/node_modules/@polkadot/rpc-core/bundle.cjs:396:19)
    at RpcCore._formatResult (/home/imri/dev/astar-js-demo/node_modules/@polkadot/rpc-core/bundle.cjs:237:27)
    at callWithRegistry (/home/imri/dev/astar-js-demo/node_modules/@polkadot/rpc-core/bundle.cjs:261:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

The repo to reproduce can found here.

jacogr commented 2 years ago

"@polkadot/api": "^6.8.1" Please update and recheck, cannot support nor debug non-current versions.

sushi30 commented 2 years ago

Script exits successfully after upgrade to current version.

polkadot-js-bot commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.