Skip to content

Commit

Permalink
chore(chisel): replace solang with solar in SolidityHelper (#9376)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Nov 22, 2024
1 parent 76a2cb0 commit 1332b6d
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 154 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ foundry-block-explorers = { version = "0.9.0", default-features = false }
foundry-compilers = { version = "0.12.3", default-features = false }
foundry-fork-db = "0.7.0"
solang-parser = "=0.3.3"
solar-parse = { version = "=0.1.0", default-features = false }

## revm
revm = { version = "18.0.0", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions crates/chisel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ semver.workspace = true
serde_json.workspace = true
serde.workspace = true
solang-parser.workspace = true
solar-parse.workspace = true
strum = { workspace = true, features = ["derive"] }
time = { version = "0.3", features = ["formatting"] }
tokio = { workspace = true, features = ["full"] }
Expand Down
14 changes: 8 additions & 6 deletions crates/chisel/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ use strum::IntoEnumIterator;
use tracing::debug;
use yansi::Paint;

/// Prompt arrow character
pub static PROMPT_ARROW: char = '➜';
static DEFAULT_PROMPT: &str = "➜ ";
/// Prompt arrow character.
pub const PROMPT_ARROW: char = '➜';
/// Prompt arrow string.
pub const PROMPT_ARROW_STR: &str = "➜";
const DEFAULT_PROMPT: &str = "➜ ";

/// Command leader character
pub static COMMAND_LEADER: char = '!';
pub const COMMAND_LEADER: char = '!';
/// Chisel character
pub static CHISEL_CHAR: &str = "⚒️";
pub const CHISEL_CHAR: &str = "⚒️";

/// Matches Solidity comments
static COMMENT_RE: LazyLock<Regex> =
Expand Down Expand Up @@ -320,7 +322,7 @@ impl ChiselDispatcher {
},
ChiselCommand::Source => match self.format_source() {
Ok(formatted_source) => DispatchResult::CommandSuccess(Some(
SolidityHelper::highlight(&formatted_source).into_owned(),
SolidityHelper::new().highlight(&formatted_source).into_owned(),
)),
Err(_) => {
DispatchResult::CommandFailed(String::from("Failed to format session source"))
Expand Down
2 changes: 1 addition & 1 deletion crates/chisel/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ fn format_event_definition(event_definition: &pt::EventDefinition) -> Result<Str
Ok(format!(
"Type: {}\n├ Name: {}\n├ Signature: {:?}\n└ Selector: {:?}",
"event".red(),
SolidityHelper::highlight(&format!(
SolidityHelper::new().highlight(&format!(
"{}({})",
&event.name,
&event
Expand Down
Loading

0 comments on commit 1332b6d

Please sign in to comment.