-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getAccount()
method fails on the latest version of cosmos-sdk
#312
Comments
Good call. I think this changed from 0.38 to launchpad as well. We are working on #306 and hopefully address this there |
It seems like there isn't a problem on the later versions of the Cosmos-SDK(0.38, 0.39) but because the Cosmos Hub is running 0.37, there was an issue. The current code is the right implementation for 0.38, so I am not sure how we should handle the 0.37 version. |
Ah, your point was that this code does not work on 0.37? Or in 0.39? Also, I know there were some changes exactly in pubkey encoding between 0.38 and 0.39... so maybe the 0.39 and 0.37 are the same. We are dropping 0.38 support in any case. Maybe you can try this PR: #311 which should work for a 0.39 based chain. (still a bit wip, but bank/auth queries/messages work). |
Nevermind, trying out the code I see this on our launchpad branch. cosmos/cosmos-sdk#6749 is the root cause. |
So, 0.39 and 0.37 have the same encoding, and 0.38 was just some broken version (with bech32 addresses > 90 chars) |
We can have a unified client that is more flexible with the format (to support 0.37-0.39). We just need to know what we need and where we get a test blockchain from. |
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). |
https://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: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.
The text was updated successfully, but these errors were encountered: