`getAccount()` method fails on the latest version of cosmos-sdk
See original GitHub issuehttps://github.com/CosmWasm/cosmjs/blob/master/packages/sdk38/src/cosmosclient.ts#L222
In the current implementation, getAccount()
method expects that the public key is delivered as bech32. I’m not sure which version of the cosmos-sdk the changes were made, but accounts on the newer versions of the SDK return as follows:
{"height":"2724145","result":{"type":"cosmos-sdk/Account","value":{"address":"cosmos1ntck6f6534u630q87jpamettes6shwgddag769","coins":[{"denom":"uatom","amount":"489300"}],"public_key":{"type":"tendermint/PubKeySecp256k1","value":"Aqb4yDyanddEzrLjbTzhBsowmh6uC6InWAMRmCISoYt5"},"account_number":"58220","sequence":"6"}}}
Thus, bech32 decoding will fail and getAccount()
method doesn’t work.
And, because the above public key type is the same as https://github.com/CosmWasm/cosmjs/blob/master/packages/sdk38/src/types.ts#L39, it is not needed to parse them.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Function `getAccount` in SigningCosmWasmClient doesn't ...
I suspect cosmos-sdk/Account is an interface and cosmos-sdk/BaseAccount is an implementation of that interface. You are using @cosmjs/launchpad, ...
Read more >types
EnsureExists returns an error if no account exists for the given address else nil. func (AccountRetriever) GetAccount ¶. func (ar AccountRetriever) GetAccount( ...
Read more >Accounts - Cosmos SDK Documentation
In the Cosmos SDK, an account designates a pair of public key PubKey and private key PrivKey . The PubKey can be derived...
Read more >Azure CosmosDB C# Function worked up to a few days ago
The function worked fine until a few days ago (last checked on Nov. ... Host: Error indexing method 'GetAccount'. ... AddTimers(), etc.).
Read more >Basic API
getAccounts (); // Initialize the gaia api with the offline signer that is injected by Keplr extension. const cosmJS = new SigningCosmosClient( ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So, 0.39 and 0.37 have the same encoding, and 0.38 was just some broken version (with bech32 addresses > 90 chars)
In #314 you see a solution to support 0.37-0.39 with one client. I think this make everyone’s life easier and only took 2 hours (fixing a bug in Uint64 along the way).