-
Notifications
You must be signed in to change notification settings - Fork 337
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
Update serde-json-wasm #1297
Update serde-json-wasm #1297
Conversation
5b08779
to
e2147fa
Compare
Yea, I was on it, but didn't aware about scripts. Just forgot to change it to draft. Thanks for hint. |
Now it is ready. |
Do we want to include in changelog minor dependency update? It's not been the case so far as I can see. |
I'm not sure if it affects our users. Is anyone installing that dependecy directly and needs to update contracts? Or is this only used transitive? Seems like users are unaffected as long as they use our wrappers: pub fn from_slice<T: DeserializeOwned>(value: &[u8]) -> StdResult<T> {
serde_json_wasm::from_slice(value).map_err(|e| StdError::parse_err(type_name::<T>(), e))
}
pub fn from_binary<T: DeserializeOwned>(value: &Binary) -> StdResult<T> {
from_slice(value.as_slice())
}
pub fn to_vec<T>(data: &T) -> StdResult<Vec<u8>>
where
T: Serialize + ?Sized,
{
serde_json_wasm::to_vec(data).map_err(|e| StdError::serialize_err(type_name::<T>(), e))
}
pub fn to_binary<T>(data: &T) -> StdResult<Binary>
where
T: Serialize + ?Sized,
{
to_vec(data).map(Binary)
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think this deserves a ## Fixed
entry since it fixes serde bugs in our to_vec
and to_binary
.
Will add a CHANGELOG entry on main. Thank you! |
btw, I just released a minor patch (v0.4.1) which includes the fix so u128/i128 work properly (merged like 6 weeks ago, but never in a tagged release). This should be pulled in automatically, but maybe we can set it to 0.4.1 (also in cosmwasm-template) to ensure people don't have issues there. (Serialising produced unparsable json) |
Yeah saw this too. I got an update 0.3.x -> 0.4.1 automatically in a consumer project. It's probably hard to install 0.4.0 instead of 0.4.1 now. Let's update but with low prio. |
@webmaster128 it is not hard, but you need to do it intentionally ("=0.4.1" or playing directly with |
Yeah, that's what I meant. Hard to do by accident. |
No description provided.