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 354 forks source link

Seeing error instead of wallet signature dialog #3906

Closed daniel-savu closed 3 years ago

daniel-savu commented 3 years ago

I have a rococo-local relay chain to which I connected the interbtc-parachain (the setup is here for reference.

Screenshot from 2021-08-26 17-55-04

In polkadot-apps, I can submit signed extrinsics to the relay chain, but not to the parachain. After clicking the Sign and Submit button, instead of being shown the wallet signature dialog, I get this error: Screenshot from 2021-08-26 17-57-53

In the console, the error is logged multiple times:

TypeError: e.query[r] is undefined
...
DRR: e.query[r] is undefined
jacogr commented 3 years ago

No idea. I would suggest debugging with your specific setup to see what is missing.

sander2 commented 3 years ago

@jacogr some additional info: this is where the error occurs. Does that give you any indication of what the problem could be?

Edit: I think the code above corresponds to this source

jacogr commented 3 years ago

For interbtc, the instances option to the API define where balances live. So it would seem in this case it is not applied?

https://github.com/interlay/interbtc-types/blob/master/definitions.json#L499-L504

EDIT: Actually in this case it would mean that that instances are available to the API, however the actual modules are not there at all. So when it tries to query the modules for balances, it fails.

gregdhill commented 3 years ago

@jacogr I think that has solved the first issue but we now see the following error:

Unable to decode storage system.account: entry 0:: createType(AccountInfo):: {"nonce":"Index","consumers":"RefCount","providers":"RefCount","sufficients":"RefCount","data":"AccountData"}:: Decoded input doesn't match input, received 0x0000000000000000010000000000000000000000000000000000000000000000…0000000000000000000000000000000000000000000000000000000000000000 (80 bytes), created 0x0000000000000000010000000000000000000000000000000000000000000000…0000000000000000000000000000000000000000000000000000000000000000 (100 bytes)
jacogr commented 3 years ago

The AccountInfo type is incorrect. If I had to guess, it may be an older structure without sufficients.

gregdhill commented 3 years ago

We use the overridden type specified in orml, could that be the issue? https://github.com/open-web3-stack/open-runtime-module-library/blob/5babe0b71cf60538ca23d41231f9558816c52ae9/tokens/src/lib.rs#L126

jacogr commented 3 years ago

Since AccountData is in the AccountInfo struct, yes, if changed, it needs to be specified.

jacogr commented 3 years ago

Closing, answered.

polkadot-js-bot commented 3 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.