Compare commits

..

3 Commits

Author SHA1 Message Date
DavidK 3184397c43 cargo fmt 2025-01-06 16:29:59 +02:00
DavidK 9c44eeac06 Adds import callback resolution to resolc compiler 2025-01-06 16:09:53 +02:00
Cyrill Leutwiler f49d145e9a update the minium supported rust version to 1.81 (#144)
Signed-off-by: xermicus <cyrill@parity.io>
2024-12-21 09:10:14 +01:00
3 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ env:
DEBIAN_CONTAINER_RUNNER: run-debian-builder.sh
REVIVE_DEBIAN_INSTALL: ${{ github.workspace }}/target/release
REVIVE_DEBIAN_BINARY: resolc
RUST_VERSION: "1.80"
RUST_VERSION: "1.81"
jobs:
build-revive-debian-x86:
+1 -1
View File
@@ -11,7 +11,7 @@ authors = [
license = "MIT/Apache-2.0"
edition = "2021"
repository = "https://github.com/paritytech/revive"
rust-version = "1.80.0"
rust-version = "1.81.0"
[workspace.dependencies]
revive-benchmarks = { version = "0.1.0-dev.7", path = "crates/benchmarks" }
+14 -2
View File
@@ -52,7 +52,7 @@ pub use self::warning::Warning;
pub mod test_utils;
pub mod tests;
use std::collections::BTreeSet;
use std::collections::{BTreeMap, BTreeSet};
use std::path::PathBuf;
/// Runs the Yul mode.
@@ -149,7 +149,7 @@ pub fn standard_output<T: Compiler>(
suppressed_warnings,
)?;
let source_code_files = solc_input
let mut source_code_files: BTreeMap<String, String> = solc_input
.sources
.iter()
.map(|(path, source)| (path.to_owned(), source.content.to_owned()))
@@ -180,6 +180,18 @@ pub fn standard_output<T: Compiler>(
}
}
// load import callbacks unspecified in input
if let Some(sources) = &solc_output.sources {
for source_path in sources.keys() {
if !source_code_files.contains_key(source_path) {
let source = std::fs::read_to_string(source_path).map_err(|e| {
anyhow::anyhow!("Can't read source file at `{}`: {}", source_path, e)
})?;
let _ = source_code_files.insert(source_path.clone(), source);
}
}
}
let project = solc_output.try_to_project(
source_code_files,
libraries,