Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

fix(solc): off by one error finding version intersection #930

Merged
merged 2 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion ethers-solc/src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ pub static RELEASES: once_cell::sync::Lazy<(svm::Releases, Vec<Version>, bool)>

/// A `Solc` version is either installed (available locally) or can be downloaded, from the remote
/// endpoint
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SolcVersion {
Installed(Version),
Remote(Version),
Expand Down
2 changes: 1 addition & 1 deletion ethers-solc/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ impl Graph {
}

let mut result = sets.pop().cloned().expect("not empty; qed.").clone();
if sets.len() > 1 {
if !sets.is_empty() {
result.retain(|item| sets.iter().all(|set| set.contains(item)));
}

Expand Down
3 changes: 0 additions & 3 deletions ethers-solc/tests/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ fn init_tracing() {
}

#[test]
#[ignore]
fn can_get_versioned_linkrefs() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("test-data/test-versioned-linkrefs");
let paths = ProjectPathsConfig::builder()
Expand All @@ -37,8 +36,6 @@ fn can_get_versioned_linkrefs() {

let compiled = project.compile().unwrap();
assert!(!compiled.has_compiler_errors());

// TODO:
}

#[test]
Expand Down