-
Notifications
You must be signed in to change notification settings - Fork 410
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
cosmwasm.GoAPI will not work on sdk.ValAddress #264
Comments
Some additional context from @YunSuk-Yeo on discord:
|
human address -> canonical address is trivial to add because you strip off information (bech32 prefix and checksum). The other direction however (canonical address -> human address) is a real problem. Here we need to know additional context and right now the whole API is only considering |
I will be fixing all the other staking-related issues this next week as part of the drive for a 0.11 release. I have thought about this and really start wondering why there are these multiple types in the CosmosSDK in the first place. For example, the validator operator address is shown as Rather than pull this complexity into the CosmWasm side, I would remove it. There are only two different pubkeys that matter - the secp256k1 sdk key, which produces an My proposal is simply to treat Validator as |
@YunSuk-Yeo do you agree to my proposal to turn the |
In the absence of a response, I would just leave it as is, and say the best "work around" is to leave Validator addresses as |
Excellent question. The two validator addresses shown at e.g. https://bigdipper.coralnet.cosmwasm.com/validator/coralvaloper10zn0d2eeust0495crtr3zqz7t688hg0sm7wr4f contain the exact same data in the bech32 address. coralvaloper10zn0d2eeust0495crtr3zqz7t688hg0sm7wr4f coral10zn0d2eeust0495crtr3zqz7t688hg0s53afrh That means you can freely convert between the two. |
Any idea how to proceed here? Currently if the user provides the In any case, we can modify HumanAddr -> CanonicalAddr to accept both types of addresses, but then Canonical->Human will always go to the
Other ideas? Preferences for one of the two approaches above? |
Sorry delayed response, hmm we have not a good option for validator address now. I'm personally prefer your suggestion. Cosmos has more bech32 prefixes, we cannot ensure which is the proper prefix.
|
In staking query binding, we pass sdk.ValAddress as HumanAddr for Validators and Delegation queries. Humanize and Canonicalize API only accept AccAddress. I recommend to fix cosmwasm.GoAPI to accept the purpose of address with default AccAddress.
wasmd/x/wasm/internal/keeper/query_plugins.go
Lines 132 to 138 in b650fa7
wasmd/x/wasm/internal/keeper/query_plugins.go
Lines 206 to 210 in b650fa7
wasmd/x/wasm/internal/keeper/api.go
Lines 14 to 25 in b650fa7
The text was updated successfully, but these errors were encountered: