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

Commit

Permalink
fix(solc): off by one error finding version intersection (#930)
Browse files Browse the repository at this point in the history
* fix: off by one error while finding intersection

* test: enable test
  • Loading branch information
mattsse authored Feb 18, 2022
1 parent d8e5e53 commit 28df48b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
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

0 comments on commit 28df48b

Please sign in to comment.