You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/std/src/binary.rs
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,7 @@ impl Serialize for Binary {
211
211
if serializer.is_human_readable(){
212
212
serializer.serialize_str(&self.to_base64())
213
213
}else{
214
-
panic!("Binary is only intended to be used with JSON serialization for now. If you are hitting this panic please open an issue at https://github.com/CosmWasm/cosmwasm describing your use case.")
214
+
serializer.serialize_bytes(&self.0)
215
215
}
216
216
}
217
217
}
@@ -225,7 +225,7 @@ impl<'de> Deserialize<'de> for Binary {
225
225
if deserializer.is_human_readable(){
226
226
deserializer.deserialize_str(Base64Visitor)
227
227
}else{
228
-
panic!("Binary is only intended to be used with JSON serialization for now. If you are hitting this panic please open an issue at https://github.com/CosmWasm/cosmwasm describing your use case.")
228
+
deserializer.deserialize_bytes(BytesVisitor)
229
229
}
230
230
}
231
231
}
@@ -250,6 +250,23 @@ impl<'de> de::Visitor<'de> for Base64Visitor {
Copy file name to clipboardExpand all lines: packages/std/src/hex_binary.rs
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -214,7 +214,7 @@ impl Serialize for HexBinary {
214
214
if serializer.is_human_readable(){
215
215
serializer.serialize_str(&self.to_hex())
216
216
}else{
217
-
panic!("HexBinary is only intended to be used with JSON serialization for now. If you are hitting this panic please open an issue at https://github.com/CosmWasm/cosmwasm describing your use case.")
217
+
serializer.serialize_bytes(&self.0)
218
218
}
219
219
}
220
220
}
@@ -228,7 +228,7 @@ impl<'de> Deserialize<'de> for HexBinary {
228
228
if deserializer.is_human_readable(){
229
229
deserializer.deserialize_str(HexVisitor)
230
230
}else{
231
-
panic!("HexBinary is only intended to be used with JSON serialization for now. If you are hitting this panic please open an issue at https://github.com/CosmWasm/cosmwasm describing your use case.")
231
+
deserializer.deserialize_bytes(BytesVisitor)
232
232
}
233
233
}
234
234
}
@@ -253,6 +253,23 @@ impl<'de> de::Visitor<'de> for HexVisitor {
0 commit comments