Skip to content

Commit f50769f

Browse files
crStivzerosnacksDaniPopes
authored
refactor(verify): remove redundant logging in Etherscan provider (#11048)
* Update mod.rs * Update mod.rs * Update mod.rs * Update crates/verify/src/etherscan/mod.rs Co-authored-by: zerosnacks <[email protected]> * Update crates/verify/src/etherscan/mod.rs Co-authored-by: zerosnacks <[email protected]> * fmt --------- Co-authored-by: zerosnacks <[email protected]> Co-authored-by: DaniPopes <[email protected]>
1 parent 8b7db3a commit f50769f

File tree

1 file changed

+7
-4
lines changed
  • crates/verify/src/etherscan

1 file changed

+7
-4
lines changed

crates/verify/src/etherscan/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ impl VerificationProvider for EtherscanVerificationProvider {
9292
.wrap_err_with(|| {
9393
// valid json
9494
let args = serde_json::to_string(&verify_args).unwrap();
95-
error!(?args, "Failed to submit verification");
9695
format!("Failed to submit contract verification, payload:\n{args}")
9796
})?;
9897

@@ -110,16 +109,16 @@ impl VerificationProvider for EtherscanVerificationProvider {
110109
|| resp.result.starts_with("The address is not a smart contract")
111110
{
112111
warn!("{}", resp.result);
113-
return Err(eyre!("Could not detect the deployment."));
112+
return Err(eyre!("Could not detect deployment: {}", resp.result));
114113
}
115114

116-
warn!("Failed verify submission: {:?}", resp);
117115
sh_err!(
118116
"Encountered an error verifying this contract:\nResponse: `{}`\nDetails:
119117
`{}`",
120118
resp.message,
121119
resp.result
122120
)?;
121+
warn!("Failed verify submission: {:?}", resp);
123122
std::process::exit(1);
124123
}
125124

@@ -186,7 +185,11 @@ impl VerificationProvider for EtherscanVerificationProvider {
186185
}
187186

188187
if resp.status == "0" {
189-
return Err(RetryError::Break(eyre!("Contract failed to verify.")));
188+
return Err(RetryError::Break(eyre!(
189+
"Contract verification failed:\nStatus: `{}`\nResult: `{}`",
190+
resp.status,
191+
resp.result
192+
)));
190193
}
191194

192195
if resp.result == "Pass - Verified" {

0 commit comments

Comments
 (0)