2
2
3
3
use std:: { error, fmt, io} ;
4
4
5
- use bitcoin:: { hex, secp256k1 } ;
5
+ use bitcoin:: hex;
6
6
7
7
/// The error type for errors produced in this library.
8
8
#[ derive( Debug ) ]
@@ -12,9 +12,7 @@ pub enum Error {
12
12
HexToBytes ( hex:: HexToBytesError ) ,
13
13
Json ( serde_json:: error:: Error ) ,
14
14
BitcoinSerialization ( bitcoin:: consensus:: encode:: FromHexError ) ,
15
- Secp256k1 ( secp256k1:: Error ) ,
16
15
Io ( io:: Error ) ,
17
- InvalidAmount ( bitcoin:: amount:: ParseAmountError ) ,
18
16
InvalidCookieFile ,
19
17
/// The JSON result had an unexpected structure.
20
18
UnexpectedStructure ,
@@ -46,18 +44,10 @@ impl From<bitcoin::consensus::encode::FromHexError> for Error {
46
44
fn from ( e : bitcoin:: consensus:: encode:: FromHexError ) -> Error { Error :: BitcoinSerialization ( e) }
47
45
}
48
46
49
- impl From < secp256k1:: Error > for Error {
50
- fn from ( e : secp256k1:: Error ) -> Error { Error :: Secp256k1 ( e) }
51
- }
52
-
53
47
impl From < io:: Error > for Error {
54
48
fn from ( e : io:: Error ) -> Error { Error :: Io ( e) }
55
49
}
56
50
57
- impl From < bitcoin:: amount:: ParseAmountError > for Error {
58
- fn from ( e : bitcoin:: amount:: ParseAmountError ) -> Error { Error :: InvalidAmount ( e) }
59
- }
60
-
61
51
impl fmt:: Display for Error {
62
52
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
63
53
use Error :: * ;
@@ -68,9 +58,7 @@ impl fmt::Display for Error {
68
58
HexToBytes ( ref e) => write ! ( f, "hex to bytes decode error: {}" , e) ,
69
59
Json ( ref e) => write ! ( f, "JSON error: {}" , e) ,
70
60
BitcoinSerialization ( ref e) => write ! ( f, "Bitcoin serialization error: {}" , e) ,
71
- Secp256k1 ( ref e) => write ! ( f, "secp256k1 error: {}" , e) ,
72
61
Io ( ref e) => write ! ( f, "I/O error: {}" , e) ,
73
- InvalidAmount ( ref e) => write ! ( f, "invalid amount: {}" , e) ,
74
62
InvalidCookieFile => write ! ( f, "invalid cookie file" ) ,
75
63
UnexpectedStructure => write ! ( f, "the JSON result had an unexpected structure" ) ,
76
64
Returned ( ref s) => write ! ( f, "the daemon returned an error string: {}" , s) ,
@@ -90,9 +78,7 @@ impl error::Error for Error {
90
78
HexToBytes ( ref e) => Some ( e) ,
91
79
Json ( ref e) => Some ( e) ,
92
80
BitcoinSerialization ( ref e) => Some ( e) ,
93
- Secp256k1 ( ref e) => Some ( e) ,
94
81
Io ( ref e) => Some ( e) ,
95
- InvalidAmount ( ref e) => Some ( e) ,
96
82
ServerVersion ( ref e) => Some ( e) ,
97
83
InvalidCookieFile | UnexpectedStructure | Returned ( _) | MissingUserPassword => None ,
98
84
}
0 commit comments