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): cached artifacts by version #9520

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from 1 commit
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
12 changes: 10 additions & 2 deletions crates/verify/src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use foundry_config::{figment, impl_figment_convert, impl_figment_convert_cast, C
use itertools::Itertools;
use reqwest::Url;
use revm_primitives::HashSet;
use semver::BuildMetadata;
use std::path::PathBuf;

use crate::provider::VerificationContext;
Expand Down Expand Up @@ -275,7 +276,7 @@ impl VerifyArgs {

let cache = project.read_cache_file().ok();

let version = if let Some(ref version) = self.compiler_version {
let mut version = if let Some(ref version) = self.compiler_version {
version.trim_start_matches('v').parse()?
} else if let Some(ref solc) = config.solc {
match solc {
Expand Down Expand Up @@ -321,7 +322,14 @@ impl VerifyArgs {
let profiles = entry
.artifacts
.get(&contract.name)
.and_then(|artifacts| artifacts.get(&version))
.and_then(|artifacts| {
let mut cached_artifacts = artifacts.get(&version);
if cached_artifacts.is_none() && version.build != BuildMetadata::EMPTY {
version.build = BuildMetadata::EMPTY;
cached_artifacts = artifacts.get(&version);
}
cached_artifacts
zerosnacks marked this conversation as resolved.
Show resolved Hide resolved
})
.map(|artifacts| artifacts.keys().collect::<HashSet<_>>())
.unwrap_or_default();

Expand Down
Loading