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
107107 Ok ( answer)
108108}
109109
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+
110120/// Response to a [`script_get_history`](../client/struct.Client.html#method.script_get_history) request.
111121#[ derive( Debug , Deserialize ) ]
112122pub struct GetHistoryRes {
@@ -189,8 +199,8 @@ pub struct GetMerkleRes {
189199pub struct HeaderNotification {
190200 /// New block height.
191201 pub height : usize ,
192- #[ serde( rename( serialize = "hex" ) ) ]
193202 /// Newly added header.
203+ #[ serde( rename = "hex" , deserialize_with = "from_hex_header" ) ]
194204 pub header : block:: BlockHeader ,
195205}
196206
You can’t perform that action at this time.
0 commit comments