Skip to content
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

fix(verify): strip path also from name #1278

Merged
merged 1 commit into from
Apr 12, 2022
Merged
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
10 changes: 6 additions & 4 deletions cli/src/cmd/forge/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use eyre::Context;
use foundry_config::Chain;
use semver::Version;
use std::{collections::BTreeMap, path::Path};
use tracing::warn;
use tracing::{trace, warn};

/// Verification arguments
#[derive(Debug, Clone, Parser)]
Expand Down Expand Up @@ -75,11 +75,13 @@ impl VerifyArgs {
eyre::bail!("Contract info must be provided in the format <path>:<name>")
}

let verify_args = self.create_verify_request()?;

let etherscan = Client::new(self.chain_id.try_into()?, &self.etherscan_key)
.wrap_err("Failed to create etherscan client")?;

let verify_args = self.create_verify_request()?;

trace!("submitting verification request {:?}", verify_args);

let resp = etherscan
.submit_contract_verification(&verify_args)
.await
Expand Down Expand Up @@ -355,7 +357,7 @@ fn standard_json_source(
let source = serde_json::to_string(&input).wrap_err("Failed to parse standard json input")?;
let name = format!(
"{}:{}",
&project.root().join(args.contract.path.as_ref().unwrap()).to_string_lossy(),
target.strip_prefix(project.root()).unwrap_or(target).display(),
args.contract.name.clone()
);
Ok((source, name, CodeFormat::StandardJsonInput))
Expand Down