File tree Expand file tree Collapse file tree 5 files changed +10
-12
lines changed
eth-bytecode-db-server/src/services
eth-bytecode-db/src/verification
verifier-alliance-database-tests/src
verifier-alliance-database/tests/integration Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ pub fn process_batch_import_error(error: Error) -> tonic::Status {
42
42
}
43
43
Error :: Verifier ( message) => {
44
44
tracing:: error!( details=%message, "Internal verifier error" ) ;
45
- tonic:: Status :: internal ( format ! ( "Verifier error: {}" , message ) )
45
+ tonic:: Status :: internal ( format ! ( "Verifier error: {message}" ) )
46
46
}
47
47
err => {
48
48
tracing:: error!( "Unexpected error" ) ;
Original file line number Diff line number Diff line change @@ -134,8 +134,8 @@ impl<'a> VerifierAllianceDbAction<'a> {
134
134
} ) ,
135
135
) => {
136
136
// 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 {
139
139
db_client,
140
140
deployment_data : AllianceContract {
141
141
chain_id : format ! ( "{chain_id}" ) ,
@@ -145,17 +145,16 @@ impl<'a> VerifierAllianceDbAction<'a> {
145
145
transaction_index,
146
146
deployer,
147
147
creation_code,
148
- runtime_code : runtime_code . unwrap ( ) ,
148
+ runtime_code,
149
149
} ,
150
- }
151
- } else {
152
- Self :: SaveIfDeploymentExists {
150
+ } ,
151
+ _ => Self :: SaveIfDeploymentExists {
153
152
db_client,
154
153
chain_id,
155
154
contract_address,
156
155
transaction_hash,
157
156
runtime_code,
158
- }
157
+ } ,
159
158
}
160
159
}
161
160
_ => Self :: IgnoreDb ,
Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ pub struct VerificationMetadata {
500
500
501
501
impl From < VerificationMetadata > for smart_contract_verifier:: VerificationMetadata {
502
502
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}" ) ) ;
504
504
let contract_address = value
505
505
. contract_address
506
506
. map ( |address| blockscout_display_bytes:: Bytes :: from ( address) . to_string ( ) ) ;
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ impl TestCase {
207
207
. one ( database_connection)
208
208
. await
209
209
. 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 :?}" ) ) ;
211
211
212
212
let expected_code_hash_keccak = Keccak256 :: digest ( & code) . to_vec ( ) ;
213
213
assert_eq ! (
Original file line number Diff line number Diff line change @@ -281,8 +281,7 @@ async fn not_override_partial_matches() {
281
281
. map_err ( |err| {
282
282
assert ! (
283
283
err. to_string( ) . contains( "is not better than existing" ) ,
284
- "unexpected error: {}" ,
285
- err
284
+ "unexpected error: {err}"
286
285
)
287
286
} )
288
287
. expect_err ( "error expected while inserting another partially verified contract" ) ;
You can’t perform that action at this time.
0 commit comments