Skip to content
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 Query msgs should be encoded with UTF-8 #1269

Closed
ud-klee opened this issue Sep 14, 2022 · 2 comments · Fixed by #1271
Closed

CosmWasm Query msgs should be encoded with UTF-8 #1269

ud-klee opened this issue Sep 14, 2022 · 2 comments · Fixed by #1271
Milestone

Comments

@ud-klee
Copy link

ud-klee commented Sep 14, 2022

Currently it is using ASCII https://github.com/cosmos/cosmjs/blob/v0.29.0-rc.1/packages/cosmwasm-stargate/src/modules/wasm/queries.ts#L120

There was a PR for ExecuteMsg #697, shouldn't it be applied to queries as well? I just tried to query a contract with Unicode contents and got

Error: Cannot encode character that is out of printable ASCII range: 38283
    ...
    at Object.queryContractSmart (/home/scott/tiger/node_modules/@cosmjs/cosmwasm-stargate/src/modules/wasm/queries.ts:120:63)
    at CosmWasmClient.queryContractSmart (/home/scott/tiger/node_modules/@cosmjs/cosmwasm-stargate/src/cosmwasmclient.ts:443:52)

The same query can be executed using the Cosmos CLI with q wasm state smart --b64 and Base64 encoded payload.

@webmaster128
Copy link
Member

That's a bug. It must be toUtf8. Thank you!

@webmaster128
Copy link
Member

Shipped as part of CosmJS 0.29.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants