@@ -21,7 +21,7 @@ pub fn to_msgpack_vec<T>(data: &T) -> StdResult<Vec<u8>>
21
21
where
22
22
T : Serialize + ?Sized ,
23
23
{
24
- rmp_serde:: to_vec ( data) . map_err ( |e| StdError :: serialize_err ( type_name :: < T > ( ) , e) )
24
+ rmp_serde:: to_vec_named ( data) . map_err ( |e| StdError :: serialize_err ( type_name :: < T > ( ) , e) )
25
25
}
26
26
27
27
/// Serializes the given data structure as MessagePack bytes.
@@ -54,7 +54,7 @@ mod tests {
54
54
55
55
fn refund_test_vector ( ) -> ( SomeMsg , & ' static [ u8 ] ) {
56
56
let msg = SomeMsg :: Refund { } ;
57
- let serialized = & [ 129 , 166 , 114 , 101 , 102 , 117 , 110 , 100 , 144 ] ;
57
+ let serialized = & [ 129 , 166 , 114 , 101 , 102 , 117 , 110 , 100 , 128 ] ;
58
58
( msg, serialized)
59
59
}
60
60
@@ -66,8 +66,9 @@ mod tests {
66
66
karma : -17 ,
67
67
} ;
68
68
let serialized = & [
69
- 129 , 171 , 114 , 101 , 108 , 101 , 97 , 115 , 101 , 95 , 97 , 108 , 108 , 148 , 163 , 102 , 111 , 111 ,
70
- 42 , 207 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 239 ,
69
+ 129 , 171 , 114 , 101 , 108 , 101 , 97 , 115 , 101 , 95 , 97 , 108 , 108 , 132 , 165 , 105 , 109 , 97 ,
70
+ 103 , 101 , 163 , 102 , 111 , 111 , 166 , 97 , 109 , 111 , 117 , 110 , 116 , 42 , 164 , 116 , 105 , 109 ,
71
+ 101 , 207 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 165 , 107 , 97 , 114 , 109 , 97 , 239 ,
71
72
] ;
72
73
( msg, serialized)
73
74
}
@@ -125,8 +126,7 @@ mod tests {
125
126
}
126
127
127
128
#[ test]
128
- #[ should_panic( expected = "invalid type: string \\ \" foo\\ \" , expected u32" ) ]
129
- fn deserialize_different_field_order_unsupported ( ) {
129
+ fn deserialize_modified_field_order ( ) {
130
130
#[ derive( Serialize , Deserialize , Debug , PartialEq ) ]
131
131
struct TestV1 {
132
132
a : String ,
0 commit comments