Skip to content

Commit

Permalink
chore(deps): update yansi to v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dcb9 committed Apr 20, 2024
1 parent 844caa8 commit c72560d
Show file tree
Hide file tree
Showing 40 changed files with 207 additions and 225 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.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ foundry-linking = { path = "crates/linking" }

# solc & compilation utilities
foundry-block-explorers = { version = "0.2.6", default-features = false }
foundry-compilers = { version = "0.3.17", default-features = false }
foundry-compilers = { version = "0.3.18", default-features = false }

## revm
# no default features to avoid c-kzg
Expand Down
2 changes: 1 addition & 1 deletion crates/anvil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ serde_repr = "0.1"
serde_json.workspace = true
serde.workspace = true
thiserror = "1"
yansi = "0.5"
yansi = "1.0"
tempfile = "3"
itertools.workspace = true
rand = "0.8"
Expand Down
28 changes: 12 additions & 16 deletions crates/anvil/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,9 @@ pub struct NodeConfig {
impl NodeConfig {
fn as_string(&self, fork: Option<&ClientFork>) -> String {
let mut config_string: String = String::new();
let _ = write!(config_string, "\n{}", Paint::green(BANNER));
let _ = write!(config_string, "\n{}", BANNER.green());
let _ = write!(config_string, "\n {VERSION_MESSAGE}");
let _ = write!(
config_string,
"\n {}",
Paint::green("https://github.com/foundry-rs/foundry")
);
let _ = write!(config_string, "\n {}", "https://github.com/foundry-rs/foundry".green());

let _ = write!(
config_string,
Expand Down Expand Up @@ -256,9 +252,9 @@ Chain ID: {}
Chain ID
==================
{}
\n{}
"#,
Paint::green(format!("\n{}", self.get_chain_id()))
self.get_chain_id().green()
);
}

Expand All @@ -268,19 +264,19 @@ Chain ID
r#"
Gas Price
==================
{}
\n{}
"#,
Paint::green(format!("\n{}", self.get_gas_price()))
self.get_gas_price().green()
);
} else {
let _ = write!(
config_string,
r#"
Base Fee
==================
{}
\n{}
"#,
Paint::green(format!("\n{}", self.get_base_fee()))
self.get_base_fee().green()
);
}

Expand All @@ -289,19 +285,19 @@ Base Fee
r#"
Gas Limit
==================
{}
\n{}
"#,
Paint::green(format!("\n{}", self.gas_limit))
self.gas_limit.green()
);

let _ = write!(
config_string,
r#"
Genesis Timestamp
==================
{}
\n{}
"#,
Paint::green(format!("\n{}", self.get_genesis_timestamp()))
self.get_genesis_timestamp().green()
);

config_string
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ semver = "1"
tempfile = "3"
tokio = { version = "1", features = ["macros", "signal"] }
tracing.workspace = true
yansi = "0.5"
yansi = "1.0"
evmole = "0.3.1"

[target.'cfg(unix)'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions crates/cast/bin/cmd/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl WalletSubcommands {
let wallets =
wallets.into_iter().map(|b| b.build()).collect::<Result<Vec<_>, _>>()?;

println!("{}", Paint::green("Successfully generated a new mnemonic."));
println!("{}", "Successfully generated a new mnemonic.".green());
println!("Phrase:\n{phrase}");
println!("\nAccounts:");
for (i, wallet) in wallets.iter().enumerate() {
Expand Down Expand Up @@ -347,7 +347,7 @@ flag to set your key via:
"`{}` keystore was saved successfully. Address: {:?}",
&account_name, address,
);
println!("{}", Paint::green(success_message));
println!("{}", success_message.green());
}
WalletSubcommands::List(cmd) => {
cmd.run().await?;
Expand Down
2 changes: 1 addition & 1 deletion crates/chisel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ solang-parser.workspace = true
strum = { workspace = true, features = ["derive"] }
time = { version = "0.3", features = ["formatting"] }
tokio = { version = "1", features = ["full"] }
yansi = "0.5"
yansi = "1.0"
tracing.workspace = true

[target.'cfg(unix)'.dependencies]
Expand Down
29 changes: 12 additions & 17 deletions crates/chisel/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ pub enum ChiselSubcommand {
async fn main() -> eyre::Result<()> {
handler::install();
utils::subscriber();
#[cfg(windows)]
if !Paint::enable_windows_ascii() {
Paint::disable()
}

utils::load_dotenv();

// Parse command args
Expand Down Expand Up @@ -165,7 +160,7 @@ async fn main() -> eyre::Result<()> {
}
Some(ChiselSubcommand::ClearCache) => {
match dispatcher.dispatch_command(ChiselCommand::ClearCache, &[]).await {
DispatchResult::CommandSuccess(Some(msg)) => println!("{}", Paint::green(msg)),
DispatchResult::CommandSuccess(Some(msg)) => println!("{}", msg.green()),
DispatchResult::CommandFailed(e) => eprintln!("{e}"),
_ => panic!("Unexpected result! Please report this bug."),
}
Expand All @@ -187,7 +182,7 @@ async fn main() -> eyre::Result<()> {
}

// Print welcome header
println!("Welcome to Chisel! Type `{}` to show available commands.", Paint::green("!help"));
println!("Welcome to Chisel! Type `{}` to show available commands.", "!help".green());

// Begin Rustyline loop
loop {
Expand Down Expand Up @@ -250,17 +245,17 @@ async fn dispatch_repl_line(dispatcher: &mut ChiselDispatcher, line: &str) -> bo
DispatchResult::Success(msg) | DispatchResult::CommandSuccess(msg) => {
debug!(%line, ?msg, "dispatch success");
if let Some(msg) = msg {
println!("{}", Paint::green(msg));
println!("{}", msg.green());
}
},
DispatchResult::UnrecognizedCommand(e) => eprintln!("{e}"),
DispatchResult::SolangParserFailed(e) => {
eprintln!("{}", Paint::red("Compilation error"));
eprintln!("{}", Paint::red(format!("{e:?}")));
eprintln!("{}", "Compilation error".red());
eprintln!("{}", format!("{e:?}").red());
}
DispatchResult::FileIoError(e) => eprintln!("{}", Paint::red(format!("⚒️ Chisel File IO Error - {e}"))),
DispatchResult::CommandFailed(msg) | DispatchResult::Failure(Some(msg)) => eprintln!("{}", Paint::red(msg)),
DispatchResult::Failure(None) => eprintln!("{}\nPlease Report this bug as a github issue if it persists: https://github.com/foundry-rs/foundry/issues/new/choose", Paint::red("⚒️ Unknown Chisel Error ⚒️")),
DispatchResult::FileIoError(e) => eprintln!("{}", format!("⚒️ Chisel File IO Error - {e}").red()),
DispatchResult::CommandFailed(msg) | DispatchResult::Failure(Some(msg)) => eprintln!("{}", msg.red()),
DispatchResult::Failure(None) => eprintln!("{}\nPlease Report this bug as a github issue if it persists: https://github.com/foundry-rs/foundry/issues/new/choose", "⚒️ Unknown Chisel Error ⚒️".red()),
}
r.is_error()
}
Expand All @@ -273,19 +268,19 @@ async fn evaluate_prelude(
) -> eyre::Result<()> {
let Some(prelude_dir) = maybe_prelude else { return Ok(()) };
if prelude_dir.is_file() {
println!("{} {}", Paint::yellow("Loading prelude source file:"), prelude_dir.display(),);
println!("{} {}", "Loading prelude source file:".yellow(), prelude_dir.display(),);
load_prelude_file(dispatcher, prelude_dir).await?;
println!("{}\n", Paint::green("Prelude source file loaded successfully!"));
println!("{}\n", "Prelude source file loaded successfully!".green());
} else {
let prelude_sources = fs::files_with_ext(prelude_dir, "sol");
let print_success_msg = !prelude_sources.is_empty();
for source_file in prelude_sources {
println!("{} {}", Paint::yellow("Loading prelude source file:"), source_file.display(),);
println!("{} {}", "Loading prelude source file:".yellow(), source_file.display(),);
load_prelude_file(dispatcher, source_file).await?;
}

if print_success_msg {
println!("{}\n", Paint::green("All prelude source files loaded successfully!"));
println!("{}\n", "All prelude source files loaded successfully!".green());
}
}
Ok(())
Expand Down
Loading

0 comments on commit c72560d

Please sign in to comment.