Skip to content

Commit

Permalink
chore(solc): provide remappings on unresolved import message
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Mar 14, 2022
1 parent 0f58c52 commit 3f1e726
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cli/src/term.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! terminal utils
use atty::{self, Stream};
use ethers::solc::{report::Reporter, CompilerInput, Solc};
use ethers::solc::{remappings::Remapping, report::Reporter, CompilerInput, Solc};
use once_cell::sync::Lazy;
use semver::Version;
use std::{
Expand Down Expand Up @@ -220,8 +220,12 @@ impl Reporter for SpinnerReporter {
self.send_msg(format!("Successfully installed solc {}", version));
}

fn on_unresolved_import(&self, import: &Path) {
self.send_msg(format!("Unable to resolve imported file: \"{}\"", import.display()));
fn on_unresolved_import(&self, import: &Path, remappings: &[Remapping]) {
self.send_msg(format!(
"Unable to resolve import: \"{}\" with remappings:\n {}",
import.display(),
remappings.into_iter().map(|r| r.to_string()).collect::<Vec<_>>().join("\n ")
));
}
}

Expand Down

0 comments on commit 3f1e726

Please sign in to comment.