File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,16 @@ where
107
107
Ok ( answer)
108
108
}
109
109
110
+ fn from_hex_header < ' de , D > ( deserializer : D ) -> Result < block:: BlockHeader , D :: Error >
111
+ where
112
+ D : de:: Deserializer < ' de > ,
113
+ {
114
+ use bitcoin:: consensus:: deserialize;
115
+
116
+ let vec: Vec < u8 > = from_hex ( deserializer) ?;
117
+ deserialize ( & vec) . map_err ( de:: Error :: custom)
118
+ }
119
+
110
120
/// Response to a [`script_get_history`](../client/struct.Client.html#method.script_get_history) request.
111
121
#[ derive( Debug , Deserialize ) ]
112
122
pub struct GetHistoryRes {
@@ -189,8 +199,8 @@ pub struct GetMerkleRes {
189
199
pub struct HeaderNotification {
190
200
/// New block height.
191
201
pub height : usize ,
192
- #[ serde( rename( serialize = "hex" ) ) ]
193
202
/// Newly added header.
203
+ #[ serde( rename = "hex" , deserialize_with = "from_hex_header" ) ]
194
204
pub header : block:: BlockHeader ,
195
205
}
196
206
You can’t perform that action at this time.
0 commit comments