Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update yansi to v1.0 #7735

Merged
merged 6 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions Cargo.lock

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

3 changes: 2 additions & 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 Expand Up @@ -214,6 +214,7 @@ vergen = { version = "8", default-features = false }
indexmap = "2.2"
tikv-jemallocator = "0.5.4"
num-format = "0.4.4"
yansi = { version = "1.0", features = ["detect-tty", "detect-env"] }

axum = "0.7"
hyper = "1.0"
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.workspace = true
tempfile = "3"
itertools.workspace = true
rand = "0.8"
Expand Down
23 changes: 12 additions & 11 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,10 @@ Chain ID: {}

Chain ID
==================

{}
"#,
Paint::green(format!("\n{}", self.get_chain_id()))
self.get_chain_id().green()
);
}

Expand All @@ -268,19 +265,21 @@ Chain ID
r#"
Gas Price
==================

{}
"#,
Paint::green(format!("\n{}", self.get_gas_price()))
self.get_gas_price().green()
);
} else {
let _ = write!(
config_string,
r#"
Base Fee
==================

{}
"#,
Paint::green(format!("\n{}", self.get_base_fee()))
self.get_base_fee().green()
);
}

Expand All @@ -289,19 +288,21 @@ Base Fee
r#"
Gas Limit
==================

{}
"#,
Paint::green(format!("\n{}", self.gas_limit))
self.gas_limit.green()
);

let _ = write!(
config_string,
r#"
Genesis Timestamp
==================

{}
"#,
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.workspace = true
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.workspace = true
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
Loading