Skip to content

Commit 64e6c91

Browse files
DaniPopesgrandizzy
authored andcommitted
refactor(chisel): refactor crate (foundry-rs#11500)
* refactor(chisel): rewrite most stuff * add todos * chore: clippy * fix: tests and bug fixes * Fix and nit, unix cfg * chore: switch to rexpect * deny * deny * try on windows * unix --------- Co-authored-by: grandizzy <[email protected]>
1 parent 91a69e1 commit 64e6c91

File tree

28 files changed

+2172
-2384
lines changed

28 files changed

+2172
-2384
lines changed

.config/nextest.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@ slow-timeout = { period = "5m", terminate-after = 4 }
1212
[[profile.default.overrides]]
1313
filter = "package(foundry-cheatcodes-spec)"
1414
retries = 0
15-
16-
[[profile.default.overrides]]
17-
filter = "package(chisel)"
18-
test-group = "chisel-serial"

Cargo.lock

Lines changed: 19 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ jiff = "0.2"
353353
heck = "0.5"
354354
uuid = "1.17.0"
355355
flate2 = "1.1"
356+
snapbox = { version = "0.6", features = ["json", "regex", "term-svg"] }
356357

357358
## Pinned dependencies. Enabled for the workspace in crates/test-utils.
358359

@@ -362,6 +363,9 @@ flate2 = "1.1"
362363
idna_adapter = "=1.1.0"
363364

364365
[patch.crates-io]
366+
# https://github.com/rust-cli/rexpect/pull/106
367+
rexpect = { git = "https://github.com/rust-cli/rexpect", rev = "2ed0b1898d7edaf6a85bedbae71a01cc578958fc" }
368+
365369
## alloy-core
366370
# alloy-dyn-abi = { path = "../../alloy-rs/core/crates/dyn-abi" }
367371
# alloy-json-abi = { path = "../../alloy-rs/core/crates/json-abi" }

crates/anvil/src/args.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::opts::{Anvil, AnvilSubcommand};
22
use clap::{CommandFactory, Parser};
33
use eyre::Result;
4-
use foundry_cli::{handler, utils};
4+
use foundry_cli::utils;
55

66
/// Run the `anvil` command line interface.
77
pub fn run() -> Result<()> {
@@ -16,10 +16,7 @@ pub fn run() -> Result<()> {
1616

1717
/// Setup the exception handler and other utilities.
1818
pub fn setup() -> Result<()> {
19-
utils::install_crypto_provider();
20-
handler::install();
21-
utils::load_dotenv();
22-
utils::enable_paint();
19+
utils::common_setup();
2320

2421
Ok(())
2522
}

crates/cast/src/args.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use alloy_rpc_types::{BlockId, BlockNumberOrTag::Latest};
1313
use clap::{CommandFactory, Parser};
1414
use clap_complete::generate;
1515
use eyre::Result;
16-
use foundry_cli::{handler, utils, utils::LoadConfig};
16+
use foundry_cli::{utils, utils::LoadConfig};
1717
use foundry_common::{
1818
abi::{get_error, get_event},
1919
fmt::{format_tokens, format_uint_exp, serialize_value_as_json},
@@ -38,11 +38,8 @@ pub fn run() -> Result<()> {
3838

3939
/// Setup the global logger and other utilities.
4040
pub fn setup() -> Result<()> {
41-
utils::install_crypto_provider();
42-
handler::install();
43-
utils::load_dotenv();
41+
utils::common_setup();
4442
utils::subscriber();
45-
utils::enable_paint();
4643

4744
Ok(())
4845
}

crates/chisel/Cargo.toml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
[package]
22
name = "chisel"
3-
authors = [
4-
"clabby <https://github.com/clabby>",
5-
"asnared <https://github.com/abigger87>",
6-
]
73
description = "Fast, utilitarian, and verbose Solidity REPL"
84

5+
authors.workspace = true
96
version.workspace = true
107
edition.workspace = true
118
rust-version.workspace = true
@@ -29,6 +26,8 @@ foundry-compilers = { workspace = true, features = ["project-util", "full"] }
2926
foundry-config.workspace = true
3027
foundry-evm.workspace = true
3128

29+
solar.workspace = true
30+
3231
alloy-dyn-abi = { workspace = true, features = ["arbitrary"] }
3332
alloy-primitives = { workspace = true, features = [
3433
"serde",
@@ -41,16 +40,14 @@ alloy-json-abi.workspace = true
4140
clap = { version = "4", features = ["derive", "env", "wrap_help"] }
4241
dirs.workspace = true
4342
eyre.workspace = true
44-
regex.workspace = true
4543
reqwest.workspace = true
4644
revm.workspace = true
47-
rustyline = "16"
45+
rustyline = "17"
46+
itertools.workspace = true
4847
semver.workspace = true
4948
serde_json.workspace = true
5049
serde.workspace = true
5150
solang-parser.workspace = true
52-
solar.workspace = true
53-
strum = { workspace = true, features = ["derive"] }
5451
time = { version = "0.3", features = ["formatting"] }
5552
yansi.workspace = true
5653
tracing.workspace = true
@@ -59,6 +56,12 @@ walkdir.workspace = true
5956
[dev-dependencies]
6057
tracing-subscriber.workspace = true
6158

59+
# REPL tests only work on Unix.
60+
[target.'cfg(unix)'.dev-dependencies]
61+
foundry-test-utils.workspace = true
62+
rexpect = "0.6"
63+
tokio.workspace = true
64+
6265
[features]
6366
default = ["jemalloc"]
6467
asm-keccak = ["alloy-primitives/asm-keccak"]

0 commit comments

Comments
 (0)