Skip to content

Commit eecfb1a

Browse files
committed
fix: merge conflicts
1 parent c070c31 commit eecfb1a

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

adapter/src/ethereum.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,8 @@ mod test {
476476
assert_eq!(expected_response, signature, "invalid signature");
477477

478478
// Verify
479-
<<<<<<< HEAD
480479
let signature =
481480
"0x9e07f12958ce7c5eb1362eb9461e4745dd9d74a42b921391393caea700bfbd6e1ad876a7d8f9202ef1fe6110dbfe87840c5676ca5c4fda9f3330694a1ac2a1fc1b";
482-
=======
483-
>>>>>>> 89abe43... fix: date check & ethereum sign
484481
let verify = eth_adapter
485482
.verify(
486483
&ValidatorId::try_from("2892f6C41E0718eeeDd49D98D648C789668cA67d")
@@ -489,7 +486,6 @@ mod test {
489486
&signature,
490487
)
491488
.expect("Failed to verify signatures");
492-
493489

494490
let sig1 = "0x9fa5852041b9818021323aff8260624fd6998c52c95d9ad5036e0db6f2bf2b2d48a188ec1d638581ff56b0a2ecceca6d3880fc65030558bd8f68b154e7ebf80f1b";
495491
let msg = "1648231285e69677531ffe70719f67a07f3d4393b8425a5a1c84b0c72434c77b";

primitives/src/validator.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ where
3030
{
3131
let validator_id = String::deserialize(deserializer)?;
3232
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+
));
3436
}
3537

3638
<[u8; 20] as FromHex>::from_hex(&validator_id[2..]).map_err(serde::de::Error::custom)

sentry/src/access.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,20 @@ fn forbidden_referrer(session: &Session) -> bool {
187187
.map(|rf| rf.split('/').nth(2))
188188
.flatten()
189189
{
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,
192197
}
193198
}
194199

195200
fn forbidden_country(session: &Session) -> bool {
196201
match session.country.as_ref() {
197202
Some(country) => country == "XX",
198-
None => false
203+
None => false,
199204
}
200205
}
201206

sentry/src/event_aggregator.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,13 @@ impl EventAggregator {
132132
events,
133133
)
134134
.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())
143138
}
139+
AccessError::RulesError(error) => ResponseError::TooManyRequests(error),
140+
AccessError::UnAuthenticated => ResponseError::Unauthorized,
141+
_ => ResponseError::BadRequest(e.to_string()),
144142
})?;
145143

146144
events

0 commit comments

Comments
 (0)