Closed reuvenpo closed 3 years ago
This is similar to #18
given a type definition:
#[derive(Serialize, Deserialize)] enum MyType { Add(i32, i32) }
running this code:
println!("{:?}", serde_json_wasm::from_slice::<MyType>(b"{\"add\":[2, 3}"));
throws panics from: (partial stack trace)
12: <&mut serde_json_wasm::ser::Serializer as serde::ser::Serializer>::serialize_tuple_variant 13: example_contract::contract::_::<impl serde::ser::Serialize for example_contract::contract::QueryMsg>::serialize 14: serde_json_wasm::ser::to_string
println!("{}", serde_json_wasm::to_string(&MyType::Add(3, 4)).unwrap_or_else(|err| err.to_string()));
shows:
Err(InvalidType)
I'll take a look at this.
This is similar to #18
given a type definition:
running this code:
throws panics from: (partial stack trace)
running this code:
shows: