Skip to content

Commit

Permalink
feat: use solc api to provide specific paths / not globs
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst committed Sep 13, 2021
1 parent 8b656b8 commit 0170d88
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 14 additions & 0 deletions FooTest2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.1;

contract FooBar {
uint256 x;

function setUp() public {
x = 1;
}

function testX() public {
require(x == 1, "x is not one");
}
}
5 changes: 2 additions & 3 deletions src/dapp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,13 @@ impl<'a> MultiContractRunner<'a> {
println!("Installing {}", upstream_version);
tokio::runtime::Runtime::new()?
.block_on(svm::install(&upstream_version))?;
println!("Done!");
found_version = Some(upstream_version);
}
}

// we did not find a version
if let Some(found_version) = found_version {
println!("Found latest version: {}", &found_version);
let entry = contracts_by_version.entry(found_version).or_insert(vec![]);
entry.push(path);
}
Expand All @@ -402,8 +402,7 @@ impl<'a> MultiContractRunner<'a> {
.clone();
compiler_path.push(format!("solc-{}", &version));

let files = files.join(",");
let mut solc = Solc::new(&files).solc_path(compiler_path);
let mut solc = Solc::new_with_paths(files).solc_path(compiler_path);
let lib_paths = lib_paths
.iter()
.filter(|path| !path.is_empty())
Expand Down

0 comments on commit 0170d88

Please sign in to comment.