@@ -22,6 +22,7 @@ impl From<Error> for AdapterError {
2222 err @ Error :: ContractInitialization ( ..) => AdapterError :: adapter ( err) ,
2323 err @ Error :: ContractQuerying ( ..) => AdapterError :: adapter ( err) ,
2424 err @ Error :: VerifyAddress ( ..) => AdapterError :: adapter ( err) ,
25+ err @ Error :: OutpaceError ( .. ) => AdapterError :: adapter ( err) ,
2526 err @ Error :: AuthenticationTokenNotIntendedForUs { .. } => {
2627 AdapterError :: authentication ( err)
2728 }
@@ -74,6 +75,8 @@ pub enum Error {
7475 } ,
7576 #[ error( "Insufficient privilege" ) ]
7677 InsufficientAuthorizationPrivilege ,
78+ #[ error( "Outpace contract error: {0}" ) ]
79+ OutpaceError ( #[ from] OutpaceError ) ,
7780}
7881
7982#[ derive( Debug , Error ) ]
@@ -123,6 +126,12 @@ pub enum EwtSigningError {
123126 DecodingHexSignature ( #[ from] hex:: FromHexError ) ,
124127}
125128
129+ #[ derive( Debug , Error ) ]
130+ pub enum OutpaceError {
131+ #[ error( "Error while signing outpace contract: {0}" ) ]
132+ SignStateroot ( String ) ,
133+ }
134+
126135#[ derive( Debug , Error ) ]
127136pub enum EwtVerifyError {
128137 #[ error( "The Ethereum Web Token header is invalid" ) ]
@@ -142,12 +151,18 @@ pub enum EwtVerifyError {
142151 /// or if Signature V component is not in "Electrum" notation (`< 27`).
143152 #[ error( "Error when decoding token signature" ) ]
144153 InvalidSignature ,
154+ #[ error( "Payload error: {0}" ) ]
155+ Payload ( #[ from] PayloadError )
156+ }
157+
158+ #[ derive( Debug , Error ) ]
159+ pub enum PayloadError {
145160 #[ error( "Payload decoding: {0}" ) ]
146- PayloadDecoding ( #[ source] base64:: DecodeError ) ,
161+ Decoding ( #[ source] base64:: DecodeError ) ,
147162 #[ error( "Payload deserialization: {0}" ) ]
148- PayloadDeserialization ( #[ from] serde_json:: Error ) ,
163+ Deserialization ( #[ from] serde_json:: Error ) ,
149164 #[ error( "Payload is not a valid UTF-8 string: {0}" ) ]
150- PayloadUtf8 ( #[ from] std:: str:: Utf8Error ) ,
165+ Utf8 ( #[ from] std:: str:: Utf8Error ) ,
151166}
152167
153168#[ cfg( test) ]
0 commit comments