Skip to content

Commit

Permalink
Don't suppress warnings (#399)
Browse files Browse the repository at this point in the history
* Pull latest ethers

* Do not suppress warnings on build

* Add `--ignored-error-codes` option

* chore: remove double success with warnings log

* chore: fix dai resolve addr test

https://github.com/gakonst/ethers-rs/pull/771/files

* fix: do not log output warnings if ignored

using gakonst/ethers-rs#775,
warnings for test contracts are not going to be logged.

Co-authored-by: Georgios Konstantopoulos <[email protected]>
  • Loading branch information
0129general and gakonst committed Jan 8, 2022
1 parent e3d841c commit ccfad5f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions cli/src/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ pub struct BuildArgs {
#[structopt(flatten)]
pub compiler: CompilerArgs,

#[structopt(help = "ignore warnings with specific error codes", long)]
pub ignored_error_codes: Vec<u64>,

#[structopt(
help = "if set to true, skips auto-detecting solc and uses what is in the user's $PATH ",
long
Expand Down Expand Up @@ -221,6 +224,10 @@ impl BuildArgs {
builder = builder.no_auto_detect();
}

for error_code in &self.ignored_error_codes {
builder = builder.ignore_error_code(*error_code);
}

let project = builder.build()?;

// if `--force` is provided, it proceeds to remove the cache
Expand Down
1 change: 0 additions & 1 deletion cli/src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ If you are in a subdirectory in a Git repository, try adding `--root .`"#,
println!("compiling...");
let output = project.compile()?;
if output.has_compiler_errors() {
// return the diagnostics error back to the user.
eyre::bail!(output.to_string())
} else if output.is_unchanged() {
println!("no files changed, compilation skippped.");
Expand Down
6 changes: 3 additions & 3 deletions utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ mod tests {
))
);

// DAI:rinkeby exists in ethers-adddressbook (0x8ad3aa5d5ff084307d28c8f514d7a193b2bfe725)
// DAI:goerli exists in ethers-adddressbook (0x11fE4B6AE13d2a6055C8D9cF65c55bac32B5d844)
assert_eq!(
resolve_addr(NameOrAddress::Name("dai".to_string()), Chain::Rinkeby).ok(),
resolve_addr(NameOrAddress::Name("dai".to_string()), Chain::Goerli).ok(),
Some(NameOrAddress::Address(
Address::from_str("0x8ad3aa5d5ff084307d28c8f514d7a193b2bfe725").unwrap()
Address::from_str("0x11fE4B6AE13d2a6055C8D9cF65c55bac32B5d844").unwrap()
))
);

Expand Down

0 comments on commit ccfad5f

Please sign in to comment.