-
Notifications
You must be signed in to change notification settings - Fork 79
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
Replace the Bytes
alias in CosmWasm context with cosmwasm_std::Binary
#1271
Comments
This is a pleasant improvement ✨. Thank you @srdtrk for the context. I have opened up PR #1272. Could you check if it works? By the way, couldn't quite understand how the |
Just note that: upon the changes in #1272, I realized to consistently use |
Yes, sorry for my ambiguous language. Even if #1255 is not resolved, we should still switch to |
Got it. Thanks. To keep things consistent throughout ibc-rs, we most likely need to come up with our own domain |
Improvement Summary
Currently, the CosmWasm context uses a
Bytes
alias to serialize/deserialize Base64 strings to bytes through the use of Serde tags (for example, see here). However, Bytes can be replaced withcosmwasm_std::Binary
, which allows us to remove all the Serde and Schemars tags. Here is an example of the proposed change:Context
As part of the ongoing migration in the 08-wasm contract API, we recommend moving away from using the
Bytes
alias in favor ofcosmwasm_std::Binary
.The recent changes to the merkle path in
08-wasm
can be seen here. Until more generic paths are supported in ibc-rs (see issue #1255), these bytes must be asserted as UTF-8 strings before being passed down to the Tendermint context.By making this change, we simplify the code and reduce potential points of failure related to serialization/deserialization.
The text was updated successfully, but these errors were encountered: