@@ -289,15 +289,14 @@ pub enum GetBlockHeaderError {
289289 /// Conversion of hex data to bytes failed.
290290 Hex ( hex:: HexToBytesError ) ,
291291 /// Consensus decoding of bytes to header failed.
292- Consensus ( encode:: Error ) ,
292+ Header ( encode:: Error ) ,
293293}
294294
295295impl fmt:: Display for GetBlockHeaderError {
296296 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
297297 match * self {
298298 Self :: Hex ( ref e) => write_err ! ( f, "conversion of hex data to bytes failed" ; e) ,
299- Self :: Consensus ( ref e) =>
300- write_err ! ( f, "consensus decoding of bytes to header failed" ; e) ,
299+ Self :: Header ( ref e) => write_err ! ( f, "consensus decoding of bytes to header failed" ; e) ,
301300 }
302301 }
303302}
@@ -307,7 +306,7 @@ impl std::error::Error for GetBlockHeaderError {
307306 fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
308307 match * self {
309308 Self :: Hex ( ref e) => Some ( e) ,
310- Self :: Consensus ( ref e) => Some ( e) ,
309+ Self :: Header ( ref e) => Some ( e) ,
311310 }
312311 }
313312}
@@ -427,8 +426,14 @@ impl From<NumericError> for GetChainStatesError {
427426pub enum GetDescriptorActivityError {
428427 /// Conversion of numeric type (e.g., height) to expected type failed.
429428 Numeric ( NumericError ) ,
430- /// Conversion of a hash string (BlockHash, Txid) failed.
431- Hash ( hex:: HexToArrayError ) ,
429+ /// Conversion of the `spend_txid` field failed.
430+ SpendTxid ( hex:: HexToArrayError ) ,
431+ /// Conversion of the `prevout_txid` field failed.
432+ PrevoutTxid ( hex:: HexToArrayError ) ,
433+ /// Conversion of the `txid` field failed.
434+ Txid ( hex:: HexToArrayError ) ,
435+ /// Conversion of the `block_hash` field failed.
436+ BlockHash ( hex:: HexToArrayError ) ,
432437 /// Conversion of the `amount` field (f64 BTC) failed.
433438 Amount ( amount:: ParseAmountError ) ,
434439 /// Conversion of script hex to ScriptBuf failed.
@@ -449,7 +454,13 @@ impl fmt::Display for GetDescriptorActivityError {
449454 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
450455 match * self {
451456 Self :: Numeric ( ref e) => write_err ! ( f, "numeric conversion failed" ; e) ,
452- Self :: Hash ( ref e) => write_err ! ( f, "conversion of a hash string failed" ; e) ,
457+ Self :: SpendTxid ( ref e) =>
458+ write_err ! ( f, "conversion of the `spend_txid` field failed" ; e) ,
459+ Self :: PrevoutTxid ( ref e) =>
460+ write_err ! ( f, "conversion of the `prevout_txid` field failed" ; e) ,
461+ Self :: Txid ( ref e) => write_err ! ( f, "conversion of the `txid` field failed" ; e) ,
462+ Self :: BlockHash ( ref e) =>
463+ write_err ! ( f, "conversion of the `block_hash` field failed" ; e) ,
453464 Self :: Amount ( ref e) => write_err ! ( f, "conversion of the `amount` field failed" ; e) ,
454465 Self :: Script ( ref e) => write_err ! ( f, "conversion of the script `hex` field failed" ; e) ,
455466 Self :: Address ( ref e) => write_err ! ( f, "conversion of the `address` field failed" ; e) ,
@@ -470,7 +481,10 @@ impl std::error::Error for GetDescriptorActivityError {
470481
471482 match * self {
472483 Numeric ( ref e) => Some ( e) ,
473- Hash ( ref e) => Some ( e) ,
484+ SpendTxid ( ref e) => Some ( e) ,
485+ PrevoutTxid ( ref e) => Some ( e) ,
486+ Txid ( ref e) => Some ( e) ,
487+ BlockHash ( ref e) => Some ( e) ,
474488 Amount ( ref e) => Some ( e) ,
475489 Script ( ref e) => Some ( e) ,
476490 Address ( ref e) => Some ( e) ,
@@ -487,7 +501,7 @@ impl From<NumericError> for GetDescriptorActivityError {
487501}
488502
489503impl From < hex:: HexToArrayError > for GetDescriptorActivityError {
490- fn from ( e : hex:: HexToArrayError ) -> Self { Self :: Hash ( e) }
504+ fn from ( e : hex:: HexToArrayError ) -> Self { Self :: BlockHash ( e) }
491505}
492506
493507impl From < amount:: ParseAmountError > for GetDescriptorActivityError {
0 commit comments