File tree Expand file tree Collapse file tree 4 files changed +17
-16
lines changed Expand file tree Collapse file tree 4 files changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -476,11 +476,8 @@ mod test {
476
476
assert_eq ! ( expected_response, signature, "invalid signature" ) ;
477
477
478
478
// Verify
479
- <<<<<<< HEAD
480
479
let signature =
481
480
"0x9e07f12958ce7c5eb1362eb9461e4745dd9d74a42b921391393caea700bfbd6e1ad876a7d8f9202ef1fe6110dbfe87840c5676ca5c4fda9f3330694a1ac2a1fc1b" ;
482
- =======
483
- >>>>>>> 89 abe43... fix: date check & ethereum sign
484
481
let verify = eth_adapter
485
482
. verify (
486
483
& ValidatorId :: try_from ( "2892f6C41E0718eeeDd49D98D648C789668cA67d" )
@@ -489,7 +486,6 @@ mod test {
489
486
& signature,
490
487
)
491
488
. expect ( "Failed to verify signatures" ) ;
492
-
493
489
494
490
let sig1 = "0x9fa5852041b9818021323aff8260624fd6998c52c95d9ad5036e0db6f2bf2b2d48a188ec1d638581ff56b0a2ecceca6d3880fc65030558bd8f68b154e7ebf80f1b" ;
495
491
let msg = "1648231285e69677531ffe70719f67a07f3d4393b8425a5a1c84b0c72434c77b" ;
Original file line number Diff line number Diff line change 30
30
{
31
31
let validator_id = String :: deserialize ( deserializer) ?;
32
32
if validator_id. is_empty ( ) || validator_id. len ( ) != 42 {
33
- return Err ( serde:: de:: Error :: custom ( "invalid validator id length" . to_string ( ) ) ) ;
33
+ return Err ( serde:: de:: Error :: custom (
34
+ "invalid validator id length" . to_string ( ) ,
35
+ ) ) ;
34
36
}
35
37
36
38
<[ u8 ; 20 ] as FromHex >:: from_hex ( & validator_id[ 2 ..] ) . map_err ( serde:: de:: Error :: custom)
Original file line number Diff line number Diff line change @@ -187,15 +187,20 @@ fn forbidden_referrer(session: &Session) -> bool {
187
187
. map ( |rf| rf. split ( '/' ) . nth ( 2 ) )
188
188
. flatten ( )
189
189
{
190
- Some ( hostname) => hostname == "localhost" || hostname == "127.0.0.1" || hostname. starts_with ( "localhost:" ) || hostname. starts_with ( "127.0.0.1:" ) ,
191
- None => false
190
+ Some ( hostname) => {
191
+ hostname == "localhost"
192
+ || hostname == "127.0.0.1"
193
+ || hostname. starts_with ( "localhost:" )
194
+ || hostname. starts_with ( "127.0.0.1:" )
195
+ }
196
+ None => false ,
192
197
}
193
198
}
194
199
195
200
fn forbidden_country ( session : & Session ) -> bool {
196
201
match session. country . as_ref ( ) {
197
202
Some ( country) => country == "XX" ,
198
- None => false
203
+ None => false ,
199
204
}
200
205
}
201
206
Original file line number Diff line number Diff line change @@ -132,15 +132,13 @@ impl EventAggregator {
132
132
events,
133
133
)
134
134
. await
135
- . map_err ( |e| {
136
- match e {
137
- AccessError :: OnlyCreatorCanCloseChannel | AccessError :: ForbiddenReferrer => {
138
- ResponseError :: Forbidden ( e. to_string ( ) )
139
- }
140
- AccessError :: RulesError ( error) => ResponseError :: TooManyRequests ( error) ,
141
- AccessError :: UnAuthenticated => ResponseError :: Unauthorized ,
142
- _ => ResponseError :: BadRequest ( e. to_string ( ) ) ,
135
+ . map_err ( |e| match e {
136
+ AccessError :: OnlyCreatorCanCloseChannel | AccessError :: ForbiddenReferrer => {
137
+ ResponseError :: Forbidden ( e. to_string ( ) )
143
138
}
139
+ AccessError :: RulesError ( error) => ResponseError :: TooManyRequests ( error) ,
140
+ AccessError :: UnAuthenticated => ResponseError :: Unauthorized ,
141
+ _ => ResponseError :: BadRequest ( e. to_string ( ) ) ,
144
142
} ) ?;
145
143
146
144
events
You can’t perform that action at this time.
0 commit comments