This commit is contained in:
AlexK 2022-03-07 13:09:59 +04:00
parent 01500f1e36
commit 773f27e296
3 changed files with 13 additions and 4 deletions

View File

@ -69,10 +69,18 @@ impl CompilerInput {
}
let mut res = Vec::new();
if !solidity_sources.is_empty() {
res.push(Self { language: "Solidity".to_string(), sources: solidity_sources, settings: Default::default() });
res.push(Self {
language: "Solidity".to_string(),
sources: solidity_sources,
settings: Default::default(),
});
}
if !yul_sources.is_empty() {
res.push(Self { language: "Yul".to_string(), sources: yul_sources, settings: Default::default() });
res.push(Self {
language: "Yul".to_string(),
sources: yul_sources,
settings: Default::default(),
});
}
res
}

View File

@ -67,7 +67,9 @@ pub fn source_files(root: impl AsRef<Path>) -> Vec<PathBuf> {
.into_iter()
.filter_map(Result::ok)
.filter(|e| e.file_type().is_file())
.filter(|e| e.path().extension().map(|ext| (ext == "sol") || (ext == "yul")).unwrap_or_default())
.filter(|e| {
e.path().extension().map(|ext| (ext == "sol") || (ext == "yul")).unwrap_or_default()
})
.map(|e| e.path().into())
.collect()
}

View File

@ -119,7 +119,6 @@ fn can_compile_yul_sample() {
assert_eq!(cache, updated_cache);
}
#[test]
fn can_compile_configured() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("test-data/dapp-sample");