@@ -8,7 +8,7 @@ use bitcoin::hex::HexToBytesError;
88use bitcoin:: { address, amount, hex, network} ;
99
1010use crate :: error:: write_err;
11- use crate :: NumericError ;
11+ use crate :: { NumericError , ScriptPubkeyError } ;
1212
1313/// Error when converting a `GetBlockVerboseOne` type into the model type.
1414#[ derive( Debug ) ]
@@ -295,6 +295,10 @@ pub enum GetDescriptorActivityError {
295295 /// We wrap the inner error to provide context. This might not be strictly necessary
296296 /// if the inner errors are distinct enough, but can be helpful.
297297 ActivityEntry ( Box < GetDescriptorActivityError > ) , // Use Box to avoid recursive type size issues
298+ /// Conversion of the `prevout_spk` field failed.
299+ PrevoutSpk ( ScriptPubkeyError ) ,
300+ /// Conversion of the `output_spk` field failed.
301+ OutputSpk ( ScriptPubkeyError ) ,
298302}
299303
300304impl fmt:: Display for GetDescriptorActivityError {
@@ -308,6 +312,8 @@ impl fmt::Display for GetDescriptorActivityError {
308312 Script ( ref e) => write_err ! ( f, "conversion of the script `hex` field failed" ; e) ,
309313 Address ( ref e) => write_err ! ( f, "conversion of the `address` field failed" ; e) ,
310314 ActivityEntry ( ref e) => write_err ! ( f, "conversion of an activity entry failed" ; e) ,
315+ PrevoutSpk ( ref e) => write_err ! ( f, "conversion of the `prevout_spk` field failed" ; e) ,
316+ OutputSpk ( ref e) => write_err ! ( f, "conversion of the `output_spk` field failed" ; e) ,
311317 }
312318 }
313319}
@@ -324,6 +330,8 @@ impl std::error::Error for GetDescriptorActivityError {
324330 Script ( ref e) => Some ( e) ,
325331 Address ( ref e) => Some ( e) ,
326332 ActivityEntry ( ref e) => Some ( & * * e) , // Deref the Box to get the inner error
333+ PrevoutSpk ( ref e) => Some ( e) ,
334+ OutputSpk ( ref e) => Some ( e) ,
327335 }
328336 }
329337}
0 commit comments