Skip to content

refactor(verify): remove redundant logging in Etherscan provider #11048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions crates/verify/src/etherscan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl VerificationProvider for EtherscanVerificationProvider {
.wrap_err_with(|| {
// valid json
let args = serde_json::to_string(&verify_args).unwrap();
error!(?args, "Failed to submit verification");
// Removed error! to avoid duplication - wrap_err_with already provides error context
format!("Failed to submit contract verification, payload:\n{args}")
})?;

Expand All @@ -109,14 +109,13 @@ impl VerificationProvider for EtherscanVerificationProvider {
if resp.result.starts_with("Unable to locate ContractCode at")
|| resp.result.starts_with("The address is not a smart contract")
{
warn!("{}", resp.result);
return Err(eyre!("Could not detect the deployment."));
// Removed warn! to avoid duplication - error message already contains the info
return Err(eyre!("Could not detect deployment: {}", resp.result));
}

warn!("Failed verify submission: {:?}", resp);
// Removed warn! to avoid duplication - sh_err! already provides error output
sh_err!(
"Encountered an error verifying this contract:\nResponse: `{}`\nDetails:
`{}`",
"Failed to verify contract - Response: `{}`, Details: `{}`",
resp.message,
resp.result
)?;
Expand Down Expand Up @@ -186,7 +185,7 @@ impl VerificationProvider for EtherscanVerificationProvider {
}

if resp.status == "0" {
return Err(RetryError::Break(eyre!("Contract failed to verify.")));
return Err(RetryError::Break(eyre!("Contract verification failed - status: {}, result: {}", resp.status, resp.result)));
}

if resp.result == "Pass - Verified" {
Expand Down