1
1
use crate :: Error as AdapterError ;
2
+ use hex:: FromHexError ;
2
3
use primitives:: {
3
4
address:: Error as AddressError , big_num:: ParseBigIntError , ChainId , ChannelId , ValidatorId ,
4
5
} ;
@@ -17,12 +18,12 @@ impl From<Error> for AdapterError {
17
18
err @ Error :: ChainNotWhitelisted ( ..) => AdapterError :: adapter ( err) ,
18
19
err @ Error :: InvalidDepositAsset ( ..) => AdapterError :: adapter ( err) ,
19
20
err @ Error :: BigNumParsing ( ..) => AdapterError :: adapter ( err) ,
20
- err @ Error :: SignMessage ( ..) => AdapterError :: adapter ( err) ,
21
+ err @ Error :: TokenSign ( ..) => AdapterError :: adapter ( err) ,
21
22
err @ Error :: VerifyMessage ( ..) => AdapterError :: adapter ( err) ,
22
23
err @ Error :: ContractInitialization ( ..) => AdapterError :: adapter ( err) ,
23
24
err @ Error :: ContractQuerying ( ..) => AdapterError :: adapter ( err) ,
24
25
err @ Error :: VerifyAddress ( ..) => AdapterError :: adapter ( err) ,
25
- err @ Error :: OutpaceError ( ..) => AdapterError :: adapter ( err) ,
26
+ err @ Error :: SigningMessage ( ..) => AdapterError :: adapter ( err) ,
26
27
err @ Error :: AuthenticationTokenNotIntendedForUs { .. } => {
27
28
AdapterError :: authentication ( err)
28
29
}
@@ -52,7 +53,7 @@ pub enum Error {
52
53
ChannelInactive ( ChannelId ) ,
53
54
/// Signing of the message failed
54
55
#[ error( "Signing message: {0}" ) ]
55
- SignMessage ( #[ from] EwtSigningError ) ,
56
+ TokenSign ( #[ from] EwtSigningError ) ,
56
57
#[ error( "Verifying message: {0}" ) ]
57
58
VerifyMessage ( #[ from] EwtVerifyError ) ,
58
59
#[ error( "Contract initialization: {0}" ) ]
@@ -76,7 +77,7 @@ pub enum Error {
76
77
#[ error( "Insufficient privilege" ) ]
77
78
InsufficientAuthorizationPrivilege ,
78
79
#[ error( "Outpace contract error: {0}" ) ]
79
- OutpaceError ( #[ from] OutpaceError ) ,
80
+ SigningMessage ( #[ from] SigningError ) ,
80
81
}
81
82
82
83
#[ derive( Debug , Error ) ]
@@ -127,9 +128,11 @@ pub enum EwtSigningError {
127
128
}
128
129
129
130
#[ derive( Debug , Error ) ]
130
- pub enum OutpaceError {
131
- #[ error( "Error while signing outpace contract: {0}" ) ]
132
- SignStateroot ( String ) ,
131
+ pub enum SigningError {
132
+ #[ error( "Error while signing message: {0}" ) ]
133
+ SignStateRoot ( String ) ,
134
+ #[ error( "Error while decoding StateRoot from hex" ) ]
135
+ StateRootDecoding ( #[ from] FromHexError ) ,
133
136
}
134
137
135
138
#[ derive( Debug , Error ) ]
@@ -151,7 +154,7 @@ pub enum EwtVerifyError {
151
154
/// or if Signature V component is not in "Electrum" notation (`< 27`).
152
155
#[ error( "Error when decoding token signature" ) ]
153
156
InvalidSignature ,
154
- #[ error( "Payload error: {0}" ) ]
157
+ #[ error( transparent ) ]
155
158
Payload ( #[ from] PayloadError ) ,
156
159
}
157
160
0 commit comments