11use crate :: Error as AdapterError ;
2+ use hex:: FromHexError ;
23use primitives:: {
34 address:: Error as AddressError , big_num:: ParseBigIntError , ChainId , ChannelId , ValidatorId ,
45} ;
@@ -17,12 +18,12 @@ impl From<Error> for AdapterError {
1718 err @ Error :: ChainNotWhitelisted ( ..) => AdapterError :: adapter ( err) ,
1819 err @ Error :: InvalidDepositAsset ( ..) => AdapterError :: adapter ( err) ,
1920 err @ Error :: BigNumParsing ( ..) => AdapterError :: adapter ( err) ,
20- err @ Error :: SignMessage ( ..) => AdapterError :: adapter ( err) ,
21+ err @ Error :: TokenSign ( ..) => AdapterError :: adapter ( err) ,
2122 err @ Error :: VerifyMessage ( ..) => AdapterError :: adapter ( err) ,
2223 err @ Error :: ContractInitialization ( ..) => AdapterError :: adapter ( err) ,
2324 err @ Error :: ContractQuerying ( ..) => AdapterError :: adapter ( err) ,
2425 err @ Error :: VerifyAddress ( ..) => AdapterError :: adapter ( err) ,
25- err @ Error :: OutpaceError ( ..) => AdapterError :: adapter ( err) ,
26+ err @ Error :: SigningMessage ( ..) => AdapterError :: adapter ( err) ,
2627 err @ Error :: AuthenticationTokenNotIntendedForUs { .. } => {
2728 AdapterError :: authentication ( err)
2829 }
@@ -52,7 +53,7 @@ pub enum Error {
5253 ChannelInactive ( ChannelId ) ,
5354 /// Signing of the message failed
5455 #[ error( "Signing message: {0}" ) ]
55- SignMessage ( #[ from] EwtSigningError ) ,
56+ TokenSign ( #[ from] EwtSigningError ) ,
5657 #[ error( "Verifying message: {0}" ) ]
5758 VerifyMessage ( #[ from] EwtVerifyError ) ,
5859 #[ error( "Contract initialization: {0}" ) ]
@@ -75,8 +76,8 @@ pub enum Error {
7576 } ,
7677 #[ error( "Insufficient privilege" ) ]
7778 InsufficientAuthorizationPrivilege ,
78- #[ error( "Outpace contract error: {0}" ) ]
79- OutpaceError ( #[ from] OutpaceError ) ,
79+ #[ error( "Signing message error: {0}" ) ]
80+ SigningMessage ( #[ from] SigningError ) ,
8081}
8182
8283#[ derive( Debug , Error ) ]
@@ -127,9 +128,11 @@ pub enum EwtSigningError {
127128}
128129
129130#[ 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 ) ,
133136}
134137
135138#[ derive( Debug , Error ) ]
@@ -151,7 +154,7 @@ pub enum EwtVerifyError {
151154 /// or if Signature V component is not in "Electrum" notation (`< 27`).
152155 #[ error( "Error when decoding token signature" ) ]
153156 InvalidSignature ,
154- #[ error( "Payload error: {0}" ) ]
157+ #[ error( transparent ) ]
155158 Payload ( #[ from] PayloadError ) ,
156159}
157160
0 commit comments