Skip to content

Commit fa23887

Browse files
fix clippy lints on alloy address validation
1 parent 49c440c commit fa23887

File tree

1 file changed

+2
-2
lines changed
  • aggregation_mode/batcher/src/server

1 file changed

+2
-2
lines changed

aggregation_mode/batcher/src/server/http.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl BatcherServer {
6464
};
6565

6666
// Check that the address is a valid ethereum address
67-
if !alloy::primitives::Address::from_str(address_raw.trim()).is_ok() {
67+
if alloy::primitives::Address::from_str(address_raw.trim()).is_err() {
6868
return HttpResponse::BadRequest()
6969
.json(AppResponse::new_unsucessfull("Invalid address", 400));
7070
}
@@ -217,7 +217,7 @@ impl BatcherServer {
217217

218218
let state = state.get_ref();
219219

220-
if !alloy::primitives::Address::from_str(&params.address.clone().trim()).is_ok() {
220+
if alloy::primitives::Address::from_str(params.address.clone().trim()).is_err() {
221221
return HttpResponse::BadRequest()
222222
.json(AppResponse::new_unsucessfull("Invalid address", 400));
223223
}

0 commit comments

Comments
 (0)