Skip to content

Commit

Permalink
is deprecated exn (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
rauljordan authored Sep 5, 2024
1 parent af9dd69 commit ca60c9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ pub const PROJECT_HASH_SECTION_NAME: &str = "project_hash";
pub const TOOLCHAIN_FILE_NAME: &str = "rust-toolchain.toml";

/// The default endpoint for connections to a Stylus-enabled Arbitrum node.
pub const DEFAULT_ENDPOINT: &str = "https://sepolia-rollup.arbitrum.io/rpc";
pub const DEFAULT_ENDPOINT: &str = "http://localhost:8547";
14 changes: 12 additions & 2 deletions main/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ fn main() -> Result<()> {
_ => {}
};

// see if custom extension exists
// see if custom extension exists and is not a deprecated extension
let custom = format!("cargo-stylus-{arg}");
if sys::command_exists(&custom) {
if sys::command_exists(&custom) && !is_deprecated_extension(&arg) {
let mut command = sys::new_command(&custom);
command.arg(arg).args(args);

Expand All @@ -440,6 +440,16 @@ fn main() -> Result<()> {
runtime.block_on(main_impl(opts))
}

// Checks if a cargo stylus extension is an old, deprecated extension which is no longer
// supported. These extensions are now incorporated as part of the `cargo-stylus` command itself and
// will be the preferred method of running them.
fn is_deprecated_extension(subcommand: &str) -> bool {
match subcommand {
"cargo-stylus-check" | "cargo-stylus-cgen" | "cargo-stylus-replay" => true,
_ => false,
}

Check warning on line 450 in main/src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

match expression looks like `matches!` macro

warning: match expression looks like `matches!` macro --> main/src/main.rs:447:5 | 447 | / match subcommand { 448 | | "cargo-stylus-check" | "cargo-stylus-cgen" | "cargo-stylus-replay" => true, 449 | | _ => false, 450 | | } | |_____^ help: try: `matches!(subcommand, "cargo-stylus-check" | "cargo-stylus-cgen" | "cargo-stylus-replay")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default
}

async fn main_impl(args: Opts) -> Result<()> {
macro_rules! run {
($expr:expr, $($msg:expr),+) => {
Expand Down

0 comments on commit ca60c9c

Please sign in to comment.