Skip to content

Commit 94a03de

Browse files
authored
chore(eth-bytecode-db): fix clippy warnings (#1429)
1 parent 172fa3b commit 94a03de

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

eth-bytecode-db/eth-bytecode-db-server/src/services/verifier_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn process_batch_import_error(error: Error) -> tonic::Status {
4242
}
4343
Error::Verifier(message) => {
4444
tracing::error!(details=%message, "Internal verifier error");
45-
tonic::Status::internal(format!("Verifier error: {}", message))
45+
tonic::Status::internal(format!("Verifier error: {message}"))
4646
}
4747
err => {
4848
tracing::error!("Unexpected error");

eth-bytecode-db/eth-bytecode-db/src/verification/handlers/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ impl<'a> VerifierAllianceDbAction<'a> {
134134
}),
135135
) => {
136136
// Contract deployment must have runtime code to exist (it may be empty, though)
137-
if is_authorized && runtime_code.is_some() {
138-
Self::SaveWithDeploymentData {
137+
match runtime_code {
138+
Some(runtime_code) if is_authorized => Self::SaveWithDeploymentData {
139139
db_client,
140140
deployment_data: AllianceContract {
141141
chain_id: format!("{chain_id}"),
@@ -145,17 +145,16 @@ impl<'a> VerifierAllianceDbAction<'a> {
145145
transaction_index,
146146
deployer,
147147
creation_code,
148-
runtime_code: runtime_code.unwrap(),
148+
runtime_code,
149149
},
150-
}
151-
} else {
152-
Self::SaveIfDeploymentExists {
150+
},
151+
_ => Self::SaveIfDeploymentExists {
153152
db_client,
154153
chain_id,
155154
contract_address,
156155
transaction_hash,
157156
runtime_code,
158-
}
157+
},
159158
}
160159
}
161160
_ => Self::IgnoreDb,

eth-bytecode-db/eth-bytecode-db/src/verification/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ pub struct VerificationMetadata {
500500

501501
impl From<VerificationMetadata> for smart_contract_verifier::VerificationMetadata {
502502
fn from(value: VerificationMetadata) -> Self {
503-
let chain_id = value.chain_id.map(|id| format!("{}", id));
503+
let chain_id = value.chain_id.map(|id| format!("{id}"));
504504
let contract_address = value
505505
.contract_address
506506
.map(|address| blockscout_display_bytes::Bytes::from(address).to_string());

eth-bytecode-db/verifier-alliance-database-tests/src/test_case.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl TestCase {
207207
.one(database_connection)
208208
.await
209209
.expect("error while retrieving code value")
210-
.unwrap_or_else(|| panic!("code hash does not exist in the database: {:?}", code_hash));
210+
.unwrap_or_else(|| panic!("code hash does not exist in the database: {code_hash:?}"));
211211

212212
let expected_code_hash_keccak = Keccak256::digest(&code).to_vec();
213213
assert_eq!(

eth-bytecode-db/verifier-alliance-database/tests/integration/verified_contracts.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@ async fn not_override_partial_matches() {
281281
.map_err(|err| {
282282
assert!(
283283
err.to_string().contains("is not better than existing"),
284-
"unexpected error: {}",
285-
err
284+
"unexpected error: {err}"
286285
)
287286
})
288287
.expect_err("error expected while inserting another partially verified contract");

0 commit comments

Comments
 (0)