cosmos / cosmjs

The Swiss Army knife to power JavaScript based client solutions ranging from Web apps/explorers over browser extensions to server-side clients like faucets/scrapers.
https://cosmos.github.io/cosmjs/
Apache License 2.0
636 stars 324 forks source link

`StargateClient.GetBalanceStaked` for noble never fires the actual query (noble doesnt have staking module, but should still fire query, like neutron) #1594

Open MbBrainz opened 1 month ago

MbBrainz commented 1 month ago

Noble chain doesn't have staking module, and so the staking query is not going to work. However, For some reason, the query is not fired, nor does the function error, leading to vague errors (like infinite fetch loading in reactQuery).

In the case of Neutron, which also doenst have a staking module, the query would be fired and would return "code":6, log": "unknown query path: unknown request", ... from the rpc. This is easily handled and seems to be the expected way.

As the root cause of this issue is still to be found, ive recorded a loom with a detailed debug description: https://www.loom.com/share/86b6ac00e0934f3a888e0224a7371579?sid=9e6239de-11a3-4853-a5f1-2eab29c71e71

https://github.com/cosmos/cosmjs/blob/f71cdc35a815f76842055ab73b89b24428698527/packages/stargate/src/stargateclient.ts#L346-L368C4