diff --git a/.cargo/config.toml b/.cargo/config.toml index d277b56a032..440c785d471 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,7 +1,7 @@ [alias] stacks-node = "run --package stacks-node --" fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module" -clippy-stacks = "clippy -p stx-genesis -p libstackerdb -p stacks-signer -p pox-locking -p clarity-types -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings" +clippy-stacks = "clippy -p stx-genesis -p libstackerdb -p stacks-signer -p pox-locking -p clarity-types -p clarity -p libsigner -p stacks-common -p clarity-cli -p stacks-cli -p stacks-inspect --no-deps --tests --all-features -- -D warnings" clippy-stackslib = "clippy -p stackslib --no-deps -- -Aclippy::all -Wclippy::indexing_slicing -Wclippy::nonminimal_bool -Wclippy::clone_on_copy" # Uncomment to improve performance slightly, at the cost of portability diff --git a/Cargo.lock b/Cargo.lock index 31652204374..4e57b01a2ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -624,6 +624,22 @@ dependencies = [ "time 0.2.27", ] +[[package]] +name = "clarity-cli" +version = "0.1.0" +dependencies = [ + "clarity 0.0.1", + "lazy_static", + "rand 0.8.5", + "rusqlite", + "serde", + "serde_derive", + "serde_json", + "slog", + "stacks-common 0.0.1", + "stackslib 0.0.1", +] + [[package]] name = "clarity-types" version = "0.0.1" @@ -3111,6 +3127,7 @@ name = "stacks-cli" version = "0.1.0" dependencies = [ "clarity 0.0.1", + "clarity-cli", "serde_json", "stacks-common 0.0.1", "stackslib 0.0.1", @@ -3179,6 +3196,7 @@ name = "stacks-inspect" version = "0.1.0" dependencies = [ "clarity 0.0.1", + "clarity-cli", "libstackerdb 0.0.1", "mutants", "regex", diff --git a/Cargo.toml b/Cargo.toml index edbaa79db61..6e9c7507883 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ members = [ "stacks-signer", "stacks-node", "contrib/stacks-inspect", + "contrib/clarity-cli", "contrib/stacks-cli" ] diff --git a/contrib/clarity-cli/Cargo.toml b/contrib/clarity-cli/Cargo.toml new file mode 100644 index 00000000000..1075c774d00 --- /dev/null +++ b/contrib/clarity-cli/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "clarity-cli" +version = "0.1.0" +edition = "2024" + +[dependencies] +clarity = { path = "../../clarity", default-features = false } +stackslib = { package = "stackslib", path = "../../stackslib", default-features = false } +stacks-common = { path = "../../stacks-common", default-features = false } +slog = { version = "2.5.2", features = [ "max_level_trace" ] } +lazy_static = { version = "1.4.0", default-features = false } +serde = { version = "1" } +serde_derive = "1" +serde_json = { workspace = true } +rand = { workspace = true } +rusqlite = { workspace = true } + +[dev-dependencies] +stacks-common = { path = "../../stacks-common", default-features = false, features = ["testing"] } diff --git a/contrib/clarity-cli/README.md b/contrib/clarity-cli/README.md new file mode 100644 index 00000000000..32ed0a6690a --- /dev/null +++ b/contrib/clarity-cli/README.md @@ -0,0 +1,15 @@ +# clarity-cli + +A thin wrapper executable for the Clarity CLI exposed by `blockstack_lib::clarity_cli`. It forwards argv to the library, prints JSON output, and exits with the underlying status code. + +Build: +```bash +cargo build -p clarity-cli +``` + +Usage: +```bash +./target/debug/clarity-cli --help +``` + +For advanced usage and subcommands, see the upstream Clarity CLI documentation or run with `--help`. diff --git a/stackslib/src/clarity_cli.rs b/contrib/clarity-cli/src/lib.rs similarity index 90% rename from stackslib/src/clarity_cli.rs rename to contrib/clarity-cli/src/lib.rs index 53dfd481cc9..c04b4c92e31 100644 --- a/stackslib/src/clarity_cli.rs +++ b/contrib/clarity-cli/src/lib.rs @@ -14,6 +14,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#[macro_use] +extern crate serde_derive; + use std::ffi::OsStr; use std::io::{Read, Write}; use std::path::PathBuf; @@ -27,42 +30,42 @@ use serde::Serialize; use serde_json::json; use stacks_common::address::c32::c32_address; use stacks_common::consts::{CHAIN_ID_MAINNET, CHAIN_ID_TESTNET}; +use stacks_common::debug; use stacks_common::types::chainstate::{ BlockHeaderHash, BurnchainHeaderHash, ConsensusHash, StacksAddress, StacksBlockId, VRFSeed, }; use stacks_common::types::sqlite::NO_PARAMS; use stacks_common::util::get_epoch_time_ms; -use stacks_common::util::hash::{bytes_to_hex, Hash160, Sha512Trunc256Sum}; - -use crate::burnchains::{PoxConstants, Txid}; -use crate::chainstate::stacks::boot::{ - BOOT_CODE_BNS, BOOT_CODE_COSTS, BOOT_CODE_COSTS_2, BOOT_CODE_COSTS_2_TESTNET, - BOOT_CODE_COSTS_3, BOOT_CODE_COST_VOTING_MAINNET, BOOT_CODE_COST_VOTING_TESTNET, - BOOT_CODE_GENESIS, BOOT_CODE_LOCKUP, BOOT_CODE_POX_MAINNET, BOOT_CODE_POX_TESTNET, - POX_2_MAINNET_CODE, POX_2_TESTNET_CODE, +use stacks_common::util::hash::{Hash160, Sha512Trunc256Sum, bytes_to_hex}; +use stackslib::burnchains::{PoxConstants, Txid}; +use stackslib::chainstate::stacks::boot::{ + BOOT_CODE_BNS, BOOT_CODE_COST_VOTING_MAINNET, BOOT_CODE_COST_VOTING_TESTNET, BOOT_CODE_COSTS, + BOOT_CODE_COSTS_2, BOOT_CODE_COSTS_2_TESTNET, BOOT_CODE_COSTS_3, BOOT_CODE_GENESIS, + BOOT_CODE_LOCKUP, BOOT_CODE_POX_MAINNET, BOOT_CODE_POX_TESTNET, POX_2_MAINNET_CODE, + POX_2_TESTNET_CODE, }; -use crate::chainstate::stacks::index::ClarityMarfTrieId; -use crate::clarity::vm::analysis::contract_interface_builder::build_contract_interface; -use crate::clarity::vm::analysis::errors::CheckError; -use crate::clarity::vm::analysis::{AnalysisDatabase, ContractAnalysis}; -use crate::clarity::vm::ast::build_ast; -use crate::clarity::vm::contexts::{AssetMap, GlobalContext, OwnedEnvironment}; -use crate::clarity::vm::costs::{ExecutionCost, LimitedCostTracker}; -use crate::clarity::vm::database::{ - BurnStateDB, ClarityDatabase, HeadersDB, STXBalance, NULL_BURN_STATE_DB, +use stackslib::chainstate::stacks::index::ClarityMarfTrieId; +use stackslib::clarity::vm::analysis::contract_interface_builder::build_contract_interface; +use stackslib::clarity::vm::analysis::errors::CheckError; +use stackslib::clarity::vm::analysis::{AnalysisDatabase, ContractAnalysis}; +use stackslib::clarity::vm::ast::build_ast; +use stackslib::clarity::vm::contexts::{AssetMap, GlobalContext, OwnedEnvironment}; +use stackslib::clarity::vm::costs::{ExecutionCost, LimitedCostTracker}; +use stackslib::clarity::vm::database::{ + BurnStateDB, ClarityDatabase, HeadersDB, NULL_BURN_STATE_DB, STXBalance, }; -use crate::clarity::vm::errors::{Error, InterpreterResult, RuntimeErrorType}; -use crate::clarity::vm::types::{PrincipalData, QualifiedContractIdentifier}; -use crate::clarity::vm::{ - analysis, ast, eval_all, ClarityVersion, ContractContext, ContractName, SymbolicExpression, - Value, +use stackslib::clarity::vm::errors::{Error, InterpreterResult, RuntimeErrorType}; +use stackslib::clarity::vm::types::{PrincipalData, QualifiedContractIdentifier}; +use stackslib::clarity::vm::{ + ClarityVersion, ContractContext, ContractName, SymbolicExpression, Value, analysis, ast, + eval_all, }; -use crate::clarity_vm::clarity::{ClarityMarfStore, ClarityMarfStoreTransaction}; -use crate::clarity_vm::database::marf::{MarfedKV, PersistentWritableMarfStore}; -use crate::clarity_vm::database::MemoryBackingStore; -use crate::core::{StacksEpochId, BLOCK_LIMIT_MAINNET_205, HELIUM_BLOCK_LIMIT_20}; -use crate::util_lib::boot::{boot_code_addr, boot_code_id}; -use crate::util_lib::db::{sqlite_open, FromColumn}; +use stackslib::clarity_vm::clarity::{ClarityMarfStore, ClarityMarfStoreTransaction}; +use stackslib::clarity_vm::database::MemoryBackingStore; +use stackslib::clarity_vm::database::marf::{MarfedKV, PersistentWritableMarfStore}; +use stackslib::core::{BLOCK_LIMIT_MAINNET_205, HELIUM_BLOCK_LIMIT_20, StacksEpochId}; +use stackslib::util_lib::boot::{boot_code_addr, boot_code_id}; +use stackslib::util_lib::db::{FromColumn, sqlite_open}; lazy_static! { pub static ref STACKS_BOOT_CODE_MAINNET_2_1: [(&'static str, &'static str); 9] = [ @@ -104,7 +107,7 @@ macro_rules! panic_test { fn print_usage(invoked_by: &str) { eprintln!( - "Usage: {} [command] + "Usage: {invoked_by} [command] where command is one of: initialize to initialize a local VM state database. @@ -118,22 +121,21 @@ where command is one of: repl to typecheck and evaluate expressions in a stdin/stdout loop. execute to execute a public function of a defined contract. generate_address to generate a random Stacks public address for testing purposes. -", - invoked_by +" ); panic_test!() } fn friendly_expect(input: Result, msg: &str) -> A { input.unwrap_or_else(|e| { - eprintln!("{}\nCaused by: {}", msg, e); + eprintln!("{msg}\nCaused by: {e}"); panic_test!(); }) } fn friendly_expect_opt(input: Option, msg: &str) -> A { input.unwrap_or_else(|| { - eprintln!("{}", msg); + eprintln!("{msg}"); panic_test!(); }) } @@ -141,6 +143,7 @@ fn friendly_expect_opt(input: Option, msg: &str) -> A { pub const DEFAULT_CLI_EPOCH: StacksEpochId = StacksEpochId::Epoch32; struct EvalInput { + #[allow(dead_code)] marf_kv: MarfedKV, contract_identifier: QualifiedContractIdentifier, content: String, @@ -269,7 +272,7 @@ fn create_or_open_db(path: &String) -> Connection { } OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE } else { - panic!("FATAL: could not stat {}", path); + panic!("FATAL: could not stat {path}"); } } Ok(_md) => { @@ -279,11 +282,10 @@ fn create_or_open_db(path: &String) -> Connection { } }; - let conn = friendly_expect( + friendly_expect( sqlite_open(path, open_flags, false), - &format!("FATAL: failed to open '{}'", path), - ); - conn + &format!("FATAL: failed to open '{path}'"), + ) } fn get_cli_chain_tip(conn: &Connection) -> StacksBlockId { @@ -311,16 +313,11 @@ fn get_cli_block_height(conn: &Connection, block_id: &StacksBlockId) -> Option String { @@ -330,11 +327,11 @@ fn get_cli_db_path(db_path: &str) -> String { let mut cli_db_path_buf = PathBuf::from(db_path); cli_db_path_buf.push("cli.sqlite"); - let cli_db_path = cli_db_path_buf + + cli_db_path_buf .to_str() - .unwrap_or_else(|| panic!("FATAL: failed to convert '{}' to a string", db_path)) - .to_string(); - cli_db_path + .unwrap_or_else(|| panic!("FATAL: failed to convert '{db_path}' to a string")) + .to_string() } // This function is pretty weird! But it helps cut down on @@ -397,12 +394,11 @@ where } fn default_chain_id(mainnet: bool) -> u32 { - let chain_id = if mainnet { + if mainnet { CHAIN_ID_MAINNET } else { CHAIN_ID_TESTNET - }; - chain_id + } } fn with_env_costs( @@ -478,7 +474,7 @@ fn save_coverage( match (coverage_folder, coverage) { (Some(coverage_folder), Some(coverage)) => { let mut coverage_file = PathBuf::from(coverage_folder); - coverage_file.push(&format!("{}_{}", prefix, get_epoch_time_ms())); + coverage_file.push(format!("{prefix}_{}", get_epoch_time_ms())); coverage_file.set_extension("clarcov"); coverage @@ -501,7 +497,7 @@ impl CLIHeadersDB { let cli_db_path = self.get_cli_db_path(); let tx = friendly_expect( self.conn.transaction(), - &format!("FATAL: failed to begin transaction on '{}'", cli_db_path), + &format!("FATAL: failed to begin transaction on '{cli_db_path}'"), ); friendly_expect( @@ -522,7 +518,7 @@ impl CLIHeadersDB { if !mainnet { friendly_expect( - tx.execute("INSERT INTO cli_config (testnet) VALUES (?1)", &[&true]), + tx.execute("INSERT INTO cli_config (testnet) VALUES (?1)", [&true]), "FATAL: failed to set testnet flag", ); } @@ -535,7 +531,7 @@ impl CLIHeadersDB { /// Create or open a new CLI DB at db_path. If it already exists, then this method is a no-op. pub fn new(db_path: &str, mainnet: bool) -> CLIHeadersDB { - let instantiate = db_path == ":memory:" || fs::metadata(&db_path).is_err(); + let instantiate = db_path == ":memory:" || fs::metadata(db_path).is_err(); let cli_db_path = get_cli_db_path(db_path); let conn = create_or_open_db(&cli_db_path); @@ -569,8 +565,7 @@ impl CLIHeadersDB { /// Make a new CLI DB in memory. pub fn new_memory(mainnet: bool) -> CLIHeadersDB { - let db = CLIHeadersDB::new(":memory:", mainnet); - db + CLIHeadersDB::new(":memory:", mainnet) } fn get_cli_db_path(&self) -> String { @@ -603,7 +598,7 @@ impl CLIHeadersDB { let parent_block_hash = get_cli_chain_tip(&tx); - let random_bytes = rand::thread_rng().gen::<[u8; 32]>(); + let random_bytes = rand::thread_rng().r#gen::<[u8; 32]>(); let next_block_hash = friendly_expect_opt( StacksBlockId::from_bytes(&random_bytes), "Failed to generate random block header.", @@ -612,7 +607,7 @@ impl CLIHeadersDB { friendly_expect( tx.execute( "INSERT INTO cli_chain_tips (block_hash) VALUES (?1)", - &[&next_block_hash], + [&next_block_hash], ), &format!( "FATAL: failed to store next block hash in '{}'", @@ -701,29 +696,17 @@ impl HeadersDB for CLIHeadersDB { _epoch: Option<&StacksEpochId>, ) -> Option { let conn = self.conn(); - if let Some(height) = get_cli_block_height(conn, id_bhh) { - Some(height * 600 + 1231006505) - } else { - None - } + get_cli_block_height(conn, id_bhh).map(|height| height * 600 + 1231006505) } fn get_stacks_block_time_for_block(&self, id_bhh: &StacksBlockId) -> Option { let conn = self.conn(); - if let Some(height) = get_cli_block_height(conn, id_bhh) { - Some(height * 10 + 1713799973) - } else { - None - } + get_cli_block_height(conn, id_bhh).map(|height| height * 10 + 1713799973) } fn get_burn_block_height_for_block(&self, id_bhh: &StacksBlockId) -> Option { let conn = self.conn(); - if let Some(height) = get_cli_block_height(conn, id_bhh) { - Some(height as u32) - } else { - None - } + get_cli_block_height(conn, id_bhh).map(|height| height as u32) } fn get_miner_address( @@ -773,8 +756,8 @@ impl HeadersDB for CLIHeadersDB { fn get_eval_input(invoked_by: &str, args: &[String]) -> EvalInput { if args.len() < 3 || args.len() > 4 { eprintln!( - "Usage: {} {} [--costs] [contract-identifier] (program.clar) [vm-state.db]", - invoked_by, args[0] + "Usage: {invoked_by} {} [--costs] [contract-identifier] (program.clar) [vm-state.db]", + args[0] ); panic_test!(); } @@ -807,11 +790,11 @@ fn get_eval_input(invoked_by: &str, args: &[String]) -> EvalInput { "Failed to open VM database.", ); // return (marf_kv, contract_identifier, vm_filename, content); - return EvalInput { + EvalInput { marf_kv, contract_identifier, content, - }; + } } #[derive(Serialize, Deserialize)] @@ -827,7 +810,7 @@ fn consume_arg( ) -> Result, String> { if let Some(ref switch) = args .iter() - .find(|ref arg| argnames.iter().find(|ref argname| argname == arg).is_some()) + .find(|ref arg| argnames.iter().any(|ref argname| argname == arg)) { let idx = args .iter() @@ -897,8 +880,7 @@ fn install_boot_code(header_db: &CLIHeadersDB, marf: &mut C) let contract_content = *boot_code_contract; debug!( - "Instantiate boot code contract '{}' ({} bytes)...", - &contract_identifier, + "Instantiate boot code contract '{contract_identifier}' ({} bytes)...", boot_code_contract.len() ); @@ -994,15 +976,11 @@ pub fn add_serialized_output(result: &mut serde_json::Value, value: Value) { /// Parse --clarity_version flag. Defaults to version for DEFAULT_CLI_EPOCH. fn parse_clarity_version_flag(argv: &mut Vec) -> ClarityVersion { - if let Ok(optarg) = consume_arg(argv, &["--clarity_version"], true) { - if let Some(s) = optarg { - friendly_expect( - s.parse::(), - &format!("Invalid clarity version: {}", s), - ) - } else { - ClarityVersion::default_for_epoch(DEFAULT_CLI_EPOCH) - } + if let Ok(Some(s)) = consume_arg(argv, &["--clarity_version"], true) { + friendly_expect( + s.parse::(), + &format!("Invalid clarity version: {s}"), + ) } else { ClarityVersion::default_for_epoch(DEFAULT_CLI_EPOCH) } @@ -1033,7 +1011,7 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option = @@ -1057,12 +1035,16 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option (i32, Option (i32, Option { // random 20 bytes - let random_bytes = rand::thread_rng().gen::<[u8; 20]>(); + let random_bytes = rand::thread_rng().r#gen::<[u8; 20]>(); // version = 22 let addr = friendly_expect(c32_address(22, &random_bytes), "Failed to generate address"); - (0, Some(json!({ "address": format!("{}", addr) }))) + (0, Some(json!({ "address": format!("{addr}") }))) } "check" => { if args.len() < 2 { eprintln!( - "Usage: {} {} [program-file.clar] [--contract_id CONTRACT_ID] [--output_analysis] [--costs] [--testnet] [--clarity_version N] (vm-state.db)", - invoked_by, args[0] + "Usage: {invoked_by} {} [program-file.clar] [--contract_id CONTRACT_ID] [--output_analysis] [--costs] [--testnet] [--clarity_version N] (vm-state.db)", + args[0] ); panic_test!(); } @@ -1145,7 +1127,7 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option (i32, Option= 3 { // use a persisted marf if testnet_given { - eprintln!("WARN: ignoring --testnet in favor of DB state in {:?}. Re-instantiate the DB to change.", &argv[2]); + eprintln!( + "WARN: ignoring --testnet in favor of DB state in {:?}. Re-instantiate the DB to change.", + &argv[2] + ); } let vm_filename = &argv[2]; @@ -1207,7 +1192,7 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option (i32, Option (i32, Option (i32, Option ").unwrap_or_else(|e| { + stdout.write_all(b"> ").unwrap_or_else(|e| { panic!("Failed to write stdout prompt string:\n{e}"); }); stdout.flush().unwrap_or_else(|e| { @@ -1336,7 +1320,7 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option { @@ -1390,7 +1374,7 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option (i32, Option (i32, Option (i32, Option (i32, Option { let mut result_json = json!({ "error": { - "runtime": serde_json::to_value(&format!("{}", error)).unwrap() + "runtime": serde_json::to_value(format!("{error}")).unwrap() }, "success": false, }); @@ -1470,7 +1454,7 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option (i32, Option (i32, Option (i32, Option (i32, Option { let mut result_json = json!({ "error": { - "runtime": serde_json::to_value(&format!("{}", error)).unwrap() + "runtime": serde_json::to_value(format!("{error}")).unwrap() }, "success": false, }); @@ -1623,8 +1607,8 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option (i32, Option (i32, Option (i32, Option (i32, Option (i32, Option (i32, Option (i32, Option (i32, Option (i32, Option()); - let json_name = format!("/tmp/test-alloc_{}.json", rand::thread_rng().gen::()); - let clar_name = format!("/tmp/test-alloc_{}.clar", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); + let json_name = format!("/tmp/test-alloc_{}.json", rand::thread_rng().r#gen::()); + let clar_name = format!("/tmp/test-alloc_{}.clar", rand::thread_rng().r#gen::()); fs::write( &json_name, @@ -1972,14 +1959,14 @@ mod test { ], ); let exit = invoked.0; - let result = invoked.1.unwrap(); + let _ = invoked.1.unwrap(); assert_eq!(exit, 0); } #[test] fn test_init_mainnet() { - let db_name = format!("/tmp/db_{}", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); let invoked = invoke_command("test", &["initialize".to_string(), db_name.clone()]); let exit = invoked.0; @@ -1994,7 +1981,7 @@ mod test { #[test] fn test_init_testnet() { - let db_name = format!("/tmp/db_{}", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); let invoked = invoke_command( "test", &[ @@ -2023,7 +2010,7 @@ mod test { #[test] fn test_samples() { - let db_name = format!("/tmp/db_{}", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); eprintln!("initialize"); invoke_command("test", &["initialize".to_string(), db_name.clone()]); @@ -2304,7 +2291,7 @@ mod test { #[test] fn test_assets() { - let db_name = format!("/tmp/db_{}", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); eprintln!("initialize"); invoke_command("test", &["initialize".to_string(), db_name.clone()]); @@ -2344,8 +2331,7 @@ mod test { assert_eq!(exit, 0); assert!(!result["message"].as_str().unwrap().is_empty()); assert!( - result["assets"]["tokens"]["S1G2081040G2081040G2081040G208105NK8PE5"] - ["S1G2081040G2081040G2081040G208105NK8PE5.tokens-ft::tokens"] + result["assets"]["tokens"]["S1G2081040G2081040G2081040G208105NK8PE5"]["S1G2081040G2081040G2081040G208105NK8PE5.tokens-ft::tokens"] == "10300" ); assert!(result["events"].as_array().unwrap().len() == 3); @@ -2400,7 +2386,7 @@ mod test { // Arrange let clar_path = format!( "/tmp/version-flag-c3-allow-{}.clar", - rand::thread_rng().gen::() + rand::thread_rng().r#gen::() ); fs::write( &clar_path, @@ -2444,7 +2430,7 @@ mod test { // Arrange let clar_path = format!( "/tmp/version-flag-c2-reject-{}.clar", - rand::thread_rng().gen::() + rand::thread_rng().r#gen::() ); fs::write( &clar_path, @@ -2487,12 +2473,12 @@ mod test { #[test] fn test_launch_clarity3_contract_passes_with_clarity3_flag() { // Arrange - let db_name = format!("/tmp/db_{}", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); invoke_command("test", &["initialize".to_string(), db_name.clone()]); let clar_path = format!( "/tmp/version-flag-launch-c3-{}.clar", - rand::thread_rng().gen::() + rand::thread_rng().r#gen::() ); fs::write( &clar_path, @@ -2536,12 +2522,12 @@ mod test { #[test] fn test_launch_clarity3_contract_fails_with_clarity2_flag() { // Arrange - let db_name = format!("/tmp/db_{}", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); invoke_command("test", &["initialize".to_string(), db_name.clone()]); let clar_path = format!( "/tmp/version-flag-launch-c2-{}.clar", - rand::thread_rng().gen::() + rand::thread_rng().r#gen::() ); fs::write( &clar_path, @@ -2585,13 +2571,13 @@ mod test { #[test] fn test_eval_clarity3_contract_passes_with_clarity3_flag() { // Arrange - let db_name = format!("/tmp/db_{}", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); invoke_command("test", &["initialize".to_string(), db_name.clone()]); // Launch minimal contract at target for eval context. let launch_src = format!( "/tmp/version-flag-eval-launch-{}.clar", - rand::thread_rng().gen::() + rand::thread_rng().r#gen::() ); fs::write(&launch_src, "(define-read-only (dummy) true)").unwrap(); let _ = invoke_command( @@ -2607,7 +2593,7 @@ mod test { // Use a Clarity3-only native expression. let clar_path = format!( "/tmp/version-flag-eval-c3-{}.clar", - rand::thread_rng().gen::() + rand::thread_rng().r#gen::() ); fs::write(&clar_path, "(get-tenure-info? time u1)").unwrap(); @@ -2638,13 +2624,13 @@ mod test { #[test] fn test_eval_clarity3_contract_fails_with_clarity2_flag() { // Arrange - let db_name = format!("/tmp/db_{}", rand::thread_rng().gen::()); + let db_name = format!("/tmp/db_{}", rand::thread_rng().r#gen::()); invoke_command("test", &["initialize".to_string(), db_name.clone()]); // Launch minimal contract at target for eval context. let launch_src = format!( "/tmp/version-flag-eval-launch-{}.clar", - rand::thread_rng().gen::() + rand::thread_rng().r#gen::() ); fs::write(&launch_src, "(define-read-only (dummy) true)").unwrap(); let _ = invoke_command( @@ -2662,7 +2648,7 @@ mod test { // Use a Clarity3-only native expression. let clar_path = format!( "/tmp/version-flag-eval-c2-{}.clar", - rand::thread_rng().gen::() + rand::thread_rng().r#gen::() ); fs::write(&clar_path, "(get-tenure-info? time u1)").unwrap(); diff --git a/stackslib/src/clarity_cli_main.rs b/contrib/clarity-cli/src/main.rs similarity index 82% rename from stackslib/src/clarity_cli_main.rs rename to contrib/clarity-cli/src/main.rs index b7690ac6650..f6d9d480c74 100644 --- a/stackslib/src/clarity_cli_main.rs +++ b/contrib/clarity-cli/src/main.rs @@ -14,23 +14,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#![allow(dead_code)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] - -extern crate blockstack_lib; extern crate serde_json; use std::{env, process}; -use blockstack_lib::clarity_cli as clarity; +use clarity_cli::invoke_command; #[allow(clippy::indexing_slicing)] fn main() { let argv: Vec = env::args().collect(); - let result = clarity::invoke_command(&argv[0], &argv[1..]); + let result = invoke_command(&argv[0], &argv[1..]); match result { (exit_code, Some(output)) => { println!("{}", &serde_json::to_string(&output).unwrap()); diff --git a/contrib/stacks-cli/Cargo.toml b/contrib/stacks-cli/Cargo.toml index a3db6d6e0ff..a942aa50c33 100644 --- a/contrib/stacks-cli/Cargo.toml +++ b/contrib/stacks-cli/Cargo.toml @@ -6,6 +6,7 @@ edition = "2024" [dependencies] stackslib = { package = "stackslib", path = "../../stackslib", default-features = false } clarity = { path = "../../clarity", default-features = false } +clarity-cli = { path = "../clarity-cli", default-features = false } stacks-common = { path = "../../stacks-common", default-features = false } serde_json = { workspace = true } diff --git a/contrib/stacks-cli/src/main.rs b/contrib/stacks-cli/src/main.rs index 34561c0659b..acc5ecbf42a 100644 --- a/contrib/stacks-cli/src/main.rs +++ b/contrib/stacks-cli/src/main.rs @@ -25,6 +25,7 @@ use std::{env, fs, io}; use clarity::vm::errors::{Error as ClarityError, RuntimeErrorType}; use clarity::vm::types::PrincipalData; use clarity::vm::{ClarityName, ClarityVersion, ContractName, Value}; +use clarity_cli::vm_execute; use stacks_common::address::{AddressHashMode, b58}; use stacks_common::codec::{Error as CodecError, StacksMessageCodec}; use stacks_common::types::chainstate::StacksAddress; @@ -41,7 +42,6 @@ use stackslib::chainstate::stacks::{ TransactionContractCall, TransactionPayload, TransactionPostConditionMode, TransactionSmartContract, TransactionSpendingCondition, TransactionVersion, }; -use stackslib::clarity_cli::vm_execute; use stackslib::core::{CHAIN_ID_MAINNET, CHAIN_ID_TESTNET}; use stackslib::net::Error as NetError; use stackslib::util_lib::strings::StacksString; diff --git a/contrib/stacks-inspect/Cargo.toml b/contrib/stacks-inspect/Cargo.toml index 785b9993981..8de68317534 100644 --- a/contrib/stacks-inspect/Cargo.toml +++ b/contrib/stacks-inspect/Cargo.toml @@ -6,6 +6,7 @@ edition = "2024" [dependencies] stackslib = { package = "stackslib", path = "../../stackslib", default-features = false } clarity = { path = "../../clarity", default-features = false } +clarity-cli = { path = "../clarity-cli", default-features = false } libstackerdb = { path = "../../libstackerdb", default-features = false } stacks-common = { path = "../../stacks-common", default-features = false } regex = { version = "1", default-features = false } diff --git a/contrib/stacks-inspect/src/lib.rs b/contrib/stacks-inspect/src/lib.rs index 444a016dbd6..02f0b275572 100644 --- a/contrib/stacks-inspect/src/lib.rs +++ b/contrib/stacks-inspect/src/lib.rs @@ -393,7 +393,7 @@ pub fn command_try_mine(argv: &[String], conf: Option<&Config>) { let print_help_and_exit = || { let n = &argv[0]; eprintln!("Usage: {n} [min-fee [max-time]]"); - eprintln!(""); + eprintln!(); eprintln!( "Given a , try to ''mine'' an anchored block. This invokes the miner block" ); @@ -731,6 +731,7 @@ fn replay_mock_mined_block(db_path: &str, block: AssembledAnchorBlock, conf: Opt } /// Validate a block against chainstate +#[allow(clippy::too_many_arguments)] fn replay_block( mut sort_tx: IndexDBTx, mut chainstate_tx: ChainstateTx, @@ -901,6 +902,7 @@ fn replay_naka_staging_block(db_path: &str, index_block_hash_hex: &str, conf: &C replay_block_nakamoto(&mut sortdb, &mut chainstate, &block, block_size).unwrap(); } +#[allow(clippy::result_large_err)] fn replay_block_nakamoto( sort_db: &mut SortitionDB, stacks_chain_state: &mut StacksChainState, @@ -1145,7 +1147,7 @@ fn replay_block_nakamoto( &mut chainstate_tx, clarity_instance, &mut burn_view_handle, - &burnchain_view, + burnchain_view, &pox_constants, &parent_header_info, &next_ready_block_snapshot.burn_header_hash, diff --git a/contrib/stacks-inspect/src/main.rs b/contrib/stacks-inspect/src/main.rs index 5743a8fc586..9755ada2341 100644 --- a/contrib/stacks-inspect/src/main.rs +++ b/contrib/stacks-inspect/src/main.rs @@ -85,7 +85,6 @@ use stackslib::chainstate::stacks::index::marf::{MARF, MARFOpenOpts, MarfConnect use stackslib::clarity::vm::ClarityVersion; use stackslib::clarity::vm::costs::ExecutionCost; use stackslib::clarity::vm::types::StacksAddressExtensions; -use stackslib::clarity_cli; use stackslib::core::MemPoolDB; use stackslib::cost_estimates::UnitEstimator; use stackslib::cost_estimates::metrics::UnitMetric; diff --git a/stacks-node/src/tests/epoch_21.rs b/stacks-node/src/tests/epoch_21.rs index 16e1dbfc389..ecf656b7f1d 100644 --- a/stacks-node/src/tests/epoch_21.rs +++ b/stacks-node/src/tests/epoch_21.rs @@ -3,7 +3,7 @@ use std::{env, thread}; use ::core::str; use clarity::vm::types::{PrincipalData, QualifiedContractIdentifier}; -use clarity::vm::{ClarityVersion, Value}; +use clarity::vm::{execute_with_parameters as execute, ClarityVersion, Value}; use stacks::burnchains::bitcoin::address::{ BitcoinAddress, LegacyBitcoinAddressType, SegwitBitcoinAddress, }; @@ -23,7 +23,6 @@ use stacks::chainstate::stacks::miner::{ set_mining_spend_amount, signal_mining_blocked, signal_mining_ready, }; use stacks::chainstate::stacks::StacksBlockHeader; -use stacks::clarity_cli::vm_execute as execute; use stacks::config::{Config, InitialBalance}; use stacks::core::test_util::make_contract_call; use stacks::core::{self, EpochList, BURNCHAIN_TX_SEARCH_WINDOW}; @@ -1089,6 +1088,8 @@ fn transition_adds_get_pox_addr_recipients() { &(*addr_variant as u8) ), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -1129,6 +1130,8 @@ fn transition_adds_get_pox_addr_recipients() { let pox_addr_tuple = execute( &format!("{{ hashbytes: 0x{bytes}, version: 0x{version:02x} }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -1565,6 +1568,8 @@ fn transition_removes_pox_sunset() { execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"), ClarityVersion::Clarity1, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(), @@ -1622,6 +1627,8 @@ fn transition_removes_pox_sunset() { execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(), @@ -2222,6 +2229,8 @@ fn test_sortition_divergence_pre_21() { execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"), ClarityVersion::Clarity1, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(), @@ -2766,6 +2775,8 @@ fn test_v1_unlock_height_with_current_stackers() { let pox_addr_tuple_1 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -2803,6 +2814,8 @@ fn test_v1_unlock_height_with_current_stackers() { let pox_addr_tuple_2 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -3022,6 +3035,8 @@ fn test_v1_unlock_height_with_delay_and_current_stackers() { let pox_addr_tuple_1 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -3071,6 +3086,8 @@ fn test_v1_unlock_height_with_delay_and_current_stackers() { let pox_addr_tuple_2 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); diff --git a/stacks-node/src/tests/epoch_22.rs b/stacks-node/src/tests/epoch_22.rs index 827c540a3b8..b3fb0fd05db 100644 --- a/stacks-node/src/tests/epoch_22.rs +++ b/stacks-node/src/tests/epoch_22.rs @@ -2,11 +2,10 @@ use std::collections::HashMap; use std::{env, thread}; use clarity::vm::types::PrincipalData; -use clarity::vm::{ClarityVersion, Value}; +use clarity::vm::{execute_with_parameters as execute, ClarityVersion, Value}; use stacks::burnchains::{Burnchain, PoxConstants}; use stacks::chainstate::stacks::address::PoxAddress; use stacks::chainstate::stacks::db::StacksChainState; -use stacks::clarity_cli::vm_execute as execute; use stacks::config::{EventKeyType, EventObserverConfig, InitialBalance}; use stacks::core::test_util::{make_contract_call, make_stacks_transfer_serialized}; use stacks::core::{self, EpochList, STACKS_EPOCH_MAX}; @@ -196,6 +195,8 @@ fn disable_pox() { let pox_addr_tuple_1 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -203,6 +204,8 @@ fn disable_pox() { let pox_addr_tuple_3 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_3}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -253,6 +256,8 @@ fn disable_pox() { let pox_addr_tuple_2 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -720,6 +725,8 @@ fn pox_2_unlock_all() { let pox_addr_tuple_1 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -727,6 +734,8 @@ fn pox_2_unlock_all() { let pox_addr_tuple_3 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_3}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -778,6 +787,8 @@ fn pox_2_unlock_all() { let pox_addr_tuple_2 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); diff --git a/stacks-node/src/tests/epoch_24.rs b/stacks-node/src/tests/epoch_24.rs index d979fd2feea..61abe8fb395 100644 --- a/stacks-node/src/tests/epoch_24.rs +++ b/stacks-node/src/tests/epoch_24.rs @@ -18,14 +18,13 @@ use std::{env, thread}; use clarity::boot_util::boot_code_id; use clarity::vm::types::PrincipalData; -use clarity::vm::{ClarityVersion, Value}; +use clarity::vm::{execute_with_parameters as execute, ClarityVersion, Value}; use stacks::burnchains::{Burnchain, PoxConstants}; use stacks::chainstate::burn::db::sortdb::SortitionDB; use stacks::chainstate::stacks::address::PoxAddress; use stacks::chainstate::stacks::boot::RawRewardSetEntry; use stacks::chainstate::stacks::db::StacksChainState; use stacks::chainstate::stacks::{Error, StacksTransaction, TransactionPayload}; -use stacks::clarity_cli::vm_execute as execute; use stacks::config::InitialBalance; use stacks::core::test_util::{make_contract_call, to_addr}; use stacks::core::{self, EpochList, StacksEpochId}; @@ -43,6 +42,7 @@ use crate::tests::neon_integrations::{ get_account, get_chain_info, get_pox_info, neon_integration_test_conf, next_block_and_wait, submit_tx, test_observer, wait_for_runloop, }; +use crate::tests::CURRENT_TESTING_EPOCH; use crate::{neon, BitcoinRegtestController, BurnchainController}; #[cfg(test)] @@ -222,6 +222,8 @@ fn fix_to_pox_contract() { let pox_addr_tuple_1 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -229,6 +231,8 @@ fn fix_to_pox_contract() { let pox_addr_tuple_3 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_3}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -280,6 +284,8 @@ fn fix_to_pox_contract() { let pox_addr_tuple_2 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -850,6 +856,8 @@ fn verify_auto_unlock_behavior() { let pox_addr_tuple_1 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_1}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -857,6 +865,8 @@ fn verify_auto_unlock_behavior() { let pox_addr_tuple_3 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_3}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); @@ -908,6 +918,8 @@ fn verify_auto_unlock_behavior() { let pox_addr_tuple_2 = execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash_2}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(); diff --git a/stacks-node/src/tests/mod.rs b/stacks-node/src/tests/mod.rs index 0629612f69d..437dc86359b 100644 --- a/stacks-node/src/tests/mod.rs +++ b/stacks-node/src/tests/mod.rs @@ -78,6 +78,9 @@ pub const SK_3: &str = "cb95ddd0fe18ec57f4f3533b95ae564b3f1ae063dbf75b46334bd862 pub const ADDR_4: &str = "ST31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZZ239N96"; +/// The epoch that is being used for tests that call the clarity vm. +pub const CURRENT_TESTING_EPOCH: StacksEpochId = StacksEpochId::Epoch32; + lazy_static! { pub static ref PUBLISH_CONTRACT: Vec = make_contract_publish( &StacksPrivateKey::from_hex( diff --git a/stacks-node/src/tests/neon_integrations.rs b/stacks-node/src/tests/neon_integrations.rs index 32a974f3096..010e8be8af9 100644 --- a/stacks-node/src/tests/neon_integrations.rs +++ b/stacks-node/src/tests/neon_integrations.rs @@ -9,7 +9,10 @@ use clarity::vm::ast::stack_depth_checker::AST_CALL_STACK_DEPTH_BUFFER; use clarity::vm::costs::ExecutionCost; use clarity::vm::types::serialization::SerializationError; use clarity::vm::types::PrincipalData; -use clarity::vm::{ClarityName, ClarityVersion, ContractName, Value, MAX_CALL_STACK_DEPTH}; +use clarity::vm::{ + execute_with_parameters as execute, ClarityName, ClarityVersion, ContractName, Value, + MAX_CALL_STACK_DEPTH, +}; use rusqlite::params; use serde::Deserialize; use serde_json::json; @@ -36,7 +39,6 @@ use stacks::chainstate::stacks::{ StacksBlock, StacksBlockHeader, StacksMicroblock, StacksPrivateKey, StacksPublicKey, StacksTransaction, TransactionContractCall, TransactionPayload, }; -use stacks::clarity_cli::vm_execute as execute; use stacks::codec::StacksMessageCodec; use stacks::config::{EventKeyType, EventObserverConfig, FeeEstimatorName, InitialBalance}; use stacks::core::mempool::{MemPoolWalkStrategy, MemPoolWalkTxTypes}; @@ -90,8 +92,8 @@ use crate::neon_node::RelayerThread; use crate::operations::BurnchainOpSigner; use crate::stacks_common::types::PrivateKey; use crate::syncctl::PoxSyncWatchdogComms; -use crate::tests::gen_random_port; use crate::tests::nakamoto_integrations::{get_key_for_cycle, wait_for}; +use crate::tests::{gen_random_port, CURRENT_TESTING_EPOCH}; use crate::{neon, BitcoinRegtestController, BurnchainController, Config, ConfigFile, Keychain}; fn inner_neon_integration_test_conf(seed: Option>) -> (Config, StacksAddress) { @@ -2368,6 +2370,8 @@ fn stx_delegate_btc_integration_test() { execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"), ClarityVersion::Clarity2, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(), @@ -5356,6 +5360,8 @@ fn pox_integration_test() { execute( &format!("{{ hashbytes: 0x{pox_pubkey_hash}, version: 0x00 }}"), ClarityVersion::Clarity1, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(), @@ -5468,6 +5474,8 @@ fn pox_integration_test() { execute( &format!("{{ hashbytes: 0x{pox_2_pubkey_hash}, version: 0x00 }}"), ClarityVersion::Clarity1, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(), @@ -5492,6 +5500,8 @@ fn pox_integration_test() { execute( &format!("{{ hashbytes: 0x{pox_2_pubkey_hash}, version: 0x00 }}"), ClarityVersion::Clarity1, + CURRENT_TESTING_EPOCH, + false, ) .unwrap() .unwrap(), diff --git a/stackslib/Cargo.toml b/stackslib/Cargo.toml index 7f8209b5824..79a64d8777a 100644 --- a/stackslib/Cargo.toml +++ b/stackslib/Cargo.toml @@ -18,10 +18,6 @@ rust-version = "1.80" name = "blockstack_lib" path = "src/lib.rs" -[[bin]] -name = "clarity-cli" -path = "src/clarity_cli_main.rs" - [dependencies] rand = { workspace = true } rand_core = { workspace = true } diff --git a/stackslib/src/lib.rs b/stackslib/src/lib.rs index 16e618da101..0213b941ed9 100644 --- a/stackslib/src/lib.rs +++ b/stackslib/src/lib.rs @@ -59,9 +59,6 @@ pub extern crate libstackerdb; pub mod chainstate; pub mod burnchains; -/// Allow panics in CLI commands -#[allow(clippy::indexing_slicing)] -pub mod clarity_cli; /// A high level library for interacting with the Clarity vm pub mod clarity_vm; pub mod config;