From 08babfe583f79f24a3058a2ab9bf4569d2737f97 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Sun, 27 Sep 2026 21:51:49 +0000 Subject: [PATCH] remove unused dependencies and dead code --- Cargo.lock | 175 +----------------- Cargo.toml | 3 - cmd/crates/soroban-spec-tools/Cargo.toml | 2 - cmd/crates/soroban-spec-typescript/Cargo.toml | 3 - cmd/crates/soroban-test/Cargo.toml | 2 - cmd/crates/stellar-ledger/Cargo.toml | 9 - .../emulator_test_support/http_transport.rs | 1 - .../src/emulator_test_support/speculos.rs | 3 - cmd/soroban-cli/Cargo.toml | 17 -- cmd/soroban-cli/build.rs | 11 -- cmd/soroban-cli/src/print.rs | 2 - cmd/soroban-cli/src/utils.rs | 2 +- 12 files changed, 3 insertions(+), 227 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ac17374e5..6006a70278 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,21 +79,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" -dependencies = [ - "anstyle", - "anstyle-parse 0.2.7", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstream" version = "1.0.0" @@ -101,7 +86,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", - "anstyle-parse 1.0.0", + "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", @@ -115,15 +100,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - [[package]] name = "anstyle-parse" version = "1.0.0" @@ -1098,7 +1074,7 @@ version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ - "anstream 1.0.0", + "anstream", "anstyle", "clap_lex", "strsim", @@ -1343,15 +1319,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" -[[package]] -name = "crossbeam-channel" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -1998,29 +1965,6 @@ dependencies = [ "syn 2.0.118", ] -[[package]] -name = "env_filter" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" -dependencies = [ - "anstream 0.6.20", - "anstyle", - "env_filter", - "jiff", - "log", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -2189,12 +2133,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fqdn" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb540cf7bc4fe6df9d8f7f0c974cfd0dce8ed4e9e8884e73433b503ee78b4e7d" - [[package]] name = "fs_extra" version = "1.3.0" @@ -2491,15 +2429,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.1" @@ -3104,30 +3033,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" -[[package]] -name = "jiff" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" -dependencies = [ - "jiff-static", - "log", - "portable-atomic", - "portable-atomic-util", - "serde", -] - -[[package]] -name = "jiff-static" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - [[package]] name = "jni" version = "0.21.1" @@ -4070,15 +3975,6 @@ version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" -[[package]] -name = "portable-atomic-util" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" -dependencies = [ - "portable-atomic", -] - [[package]] name = "potential_utf" version = "0.1.3" @@ -5358,10 +5254,8 @@ dependencies = [ name = "soroban-cli" version = "28.1.0" dependencies = [ - "assert_cmd", "assert_fs", "async-compression", - "async-trait", "base64 0.21.7", "bytesize", "cargo_metadata", @@ -5373,12 +5267,8 @@ dependencies = [ "directories", "dotenvy", "ed25519-dalek", - "ethnum", "flate2", - "fqdn", "futures", - "futures-util", - "glob", "heck 0.5.0", "hex", "home", @@ -5389,12 +5279,10 @@ dependencies = [ "jsonrpsee-types", "keyring", "mockito", - "num-bigint", "open", "path-slash", "pathdiff", "phf", - "predicates", "rand 0.8.7", "regex", "reqwest", @@ -5405,7 +5293,6 @@ dependencies = [ "semver", "sep5", "serde", - "serde-aux", "serde_json", "serde_with", "serial_test", @@ -5423,24 +5310,18 @@ dependencies = [ "stellar-rpc-client", "stellar-strkey 0.0.18", "stellar-xdr", - "strsim", - "strum 0.17.1", - "strum_macros 0.17.1", "tar", "tempfile", "termcolor", - "termcolor_output", "thiserror 1.0.69", "tokio", "tokio-util", "toml", "toml_edit", "tracing", - "tracing-appender", "tracing-subscriber", "ulid", "url", - "walkdir", "wasm-gen", "wasm-opt", "wasmparser 0.116.1", @@ -5637,24 +5518,19 @@ dependencies = [ "stellar-strkey 0.0.18", "stellar-xdr", "thiserror 1.0.69", - "tokio", "wasm-encoder 0.235.0", "wasmparser 0.116.1", - "which", ] [[package]] name = "soroban-spec-typescript" version = "28.1.0" dependencies = [ - "base64 0.21.7", "heck 0.4.1", "include_dir", "itertools 0.10.5", "pretty_assertions", - "prettyplease", "serde", - "serde_derive", "serde_json", "sha2 0.9.9", "soroban-spec", @@ -5678,7 +5554,6 @@ dependencies = [ "markdown", "predicates", "reqwest", - "sep5", "serde_json", "sha2 0.10.9", "shell-escape", @@ -5701,7 +5576,6 @@ dependencies = [ "walkdir", "wasm-encoder 0.235.0", "wasmparser 0.116.1", - "which", ] [[package]] @@ -5791,23 +5665,14 @@ name = "stellar-ledger" version = "28.1.0" dependencies = [ "async-trait", - "byteorder 1.5.0", - "ed25519-dalek", - "env_logger", "hex", - "home", "httpmock", "ledger-transport", "ledger-transport-hid", - "log", - "once_cell", "phf", - "pretty_assertions", "reqwest", "serde", - "serde_derive", "serde_json", - "serial_test", "sha2 0.10.9", "stellar-strkey 0.0.18", "stellar-xdr", @@ -5947,12 +5812,6 @@ dependencies = [ "syn 2.0.118", ] -[[package]] -name = "strum" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "530efb820d53b712f4e347916c5e7ed20deb76a4f0457943b3182fb889b06d2c" - [[package]] name = "strum" version = "0.24.1" @@ -5965,18 +5824,6 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -[[package]] -name = "strum_macros" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6e163a520367c465f59e0a61a23cfae3b10b6546d78b6f672a382be79f7110" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "strum_macros" version = "0.24.3" @@ -6619,18 +6466,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-appender" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" -dependencies = [ - "crossbeam-channel", - "thiserror 1.0.69", - "time", - "tracing-subscriber", -] - [[package]] name = "tracing-attributes" version = "0.1.30" @@ -6742,12 +6577,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - [[package]] name = "unicode-width" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index c597dddfe6..a4e1970f5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,6 @@ escape-bytes = "0.1.1" hex = "0.4.3" itertools = "0.10.0" async-trait = "0.1.76" -serde-aux = "4.1.2" serde_json = "1.0.82" serde = "1.0.82" clap = { version = "4.1.8", features = [ @@ -98,13 +97,11 @@ clap = { version = "4.1.8", features = [ clap_complete = "4.1.4" tracing = "0.1.37" tracing-subscriber = "0.3.20" -tracing-appender = "0.2.3" which = "4.4.0" wasmparser = "0.116.1" directories = "5.0.1" ulid = "1.1" termcolor = "1.1.3" -termcolor_output = "1.0.1" ed25519-dalek = ">= 2.1.1" http = "1.0.0" walkdir = "2.5.0" diff --git a/cmd/crates/soroban-spec-tools/Cargo.toml b/cmd/crates/soroban-spec-tools/Cargo.toml index 00ad8186dc..d282e44af7 100644 --- a/cmd/crates/soroban-spec-tools/Cargo.toml +++ b/cmd/crates/soroban-spec-tools/Cargo.toml @@ -34,5 +34,3 @@ indexmap = { version = "2.7", features = ["serde"] } [dev-dependencies] -which = { workspace = true } -tokio = "1.28.1" diff --git a/cmd/crates/soroban-spec-typescript/Cargo.toml b/cmd/crates/soroban-spec-typescript/Cargo.toml index 5509a52d6c..72849ff063 100644 --- a/cmd/crates/soroban-spec-typescript/Cargo.toml +++ b/cmd/crates/soroban-spec-typescript/Cargo.toml @@ -14,14 +14,11 @@ rust-version.workspace = true soroban-spec = { workspace = true } thiserror = "1.0.32" serde = "1.0.82" -serde_derive = "1.0.82" serde_json = { version = "1.0.82", features = ["preserve_order"] } sha2 = "0.9.9" -prettyplease = "0.2.4" include_dir = { version = "0.7.3", features = ["glob"] } heck = "0.4.1" itertools = { workspace = true } -base64 = { workspace = true } [dependencies.stellar-xdr] workspace = true diff --git a/cmd/crates/soroban-test/Cargo.toml b/cmd/crates/soroban-test/Cargo.toml index f89fc70668..7ae0632362 100644 --- a/cmd/crates/soroban-test/Cargo.toml +++ b/cmd/crates/soroban-test/Cargo.toml @@ -22,7 +22,6 @@ soroban-spec = { workspace = true } soroban-spec-tools = { workspace = true } soroban-ledger-snapshot = { workspace = true } stellar-strkey = { workspace = true } -sep5 = { workspace = true } soroban-cli = { workspace = true } soroban-rpc = { workspace = true } stellar-ledger = { workspace = true } @@ -44,7 +43,6 @@ shell-escape = "0.1.5" wasm-encoder = "0.235.0" wasmparser = { workspace = true } serde_json = "1.0.93" -which = { workspace = true } tokio = "1.28.1" walkdir = "2.4.0" ulid.workspace = true diff --git a/cmd/crates/stellar-ledger/Cargo.toml b/cmd/crates/stellar-ledger/Cargo.toml index 6930b30940..1de72e0332 100644 --- a/cmd/crates/stellar-ledger/Cargo.toml +++ b/cmd/crates/stellar-ledger/Cargo.toml @@ -13,17 +13,13 @@ rust-version.workspace = true [dependencies] thiserror = "1.0.32" serde = "1.0.82" -serde_derive = "1.0.82" serde_json = "1.0.82" sha2 = { workspace = true } -ed25519-dalek = { workspace = true } stellar-strkey = { workspace = true } ledger-transport-hid = "0.10.0" ledger-transport = "0.10.0" tracing = { workspace = true } hex.workspace = true -byteorder = "1.5.0" -home = "0.5.9" tokio = { version = "1", features = ["full"] } reqwest = { workspace = true, features = ["json"] } phf = { version = "0.11.2", features = ["macros"], optional = true } @@ -35,11 +31,6 @@ workspace = true features = ["std", "serde"] [dev-dependencies] -env_logger = "0.11.3" -log = "0.4.21" -once_cell = "1.19.0" -pretty_assertions = "1.2.1" -serial_test = "3.0.0" httpmock = { workspace = true } test-case = "3.3.1" diff --git a/cmd/crates/stellar-ledger/src/emulator_test_support/http_transport.rs b/cmd/crates/stellar-ledger/src/emulator_test_support/http_transport.rs index 6345ef9637..7f2aeab974 100644 --- a/cmd/crates/stellar-ledger/src/emulator_test_support/http_transport.rs +++ b/cmd/crates/stellar-ledger/src/emulator_test_support/http_transport.rs @@ -40,7 +40,6 @@ struct ZemuResponse { } impl Emulator { - #[allow(dead_code)] //this is being used in tests only #[must_use] pub fn new(host: &str, port: u16) -> Self { Self { diff --git a/cmd/crates/stellar-ledger/src/emulator_test_support/speculos.rs b/cmd/crates/stellar-ledger/src/emulator_test_support/speculos.rs index 81a11b43a4..67d7b97e6b 100644 --- a/cmd/crates/stellar-ledger/src/emulator_test_support/speculos.rs +++ b/cmd/crates/stellar-ledger/src/emulator_test_support/speculos.rs @@ -9,7 +9,6 @@ const TAG: &str = "speculos-3a3439f6b45eca7f56395673caaf434c202e7005"; const TEST_SEED_PHRASE: &str = "\"other base behind follow wet put glad muscle unlock sell income october\""; -#[allow(dead_code)] static ENV: &Map = &Map(phf::phf_map! { "BOLOS_SDK"=> "/project/deps/nanos-secure-sdk", "BOLOS_ENV" => "/opt/bolos", @@ -35,9 +34,7 @@ pub struct Speculos { const DEFAULT_APP_PATH: &str = "/project/app/bin"; impl Speculos { - #[allow(dead_code)] pub fn new(ledger_device_model: String) -> Self { - #[allow(unused_mut)] let apps_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("tests") .join("test_fixtures") diff --git a/cmd/soroban-cli/Cargo.toml b/cmd/soroban-cli/Cargo.toml index adb27826f0..9719614181 100644 --- a/cmd/soroban-cli/Cargo.toml +++ b/cmd/soroban-cli/Cargo.toml @@ -54,22 +54,18 @@ clap = { workspace = true, features = [ "string", ] } clap_complete = { workspace = true } -async-trait = { workspace = true } base64 = { workspace = true } thiserror = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } -serde-aux = { workspace = true } hex = { workspace = true } path-slash = { workspace = true } -num-bigint = "0.4" # Pinned to match the version pulled in by soroban-rpc (jsonrpsee-core) so that # downcasting RPC errors to `ErrorObjectOwned` resolves to the same type. jsonrpsee-types = "0.26" tokio = { version = "1", features = ["full"] } tokio-util = { version = "0.7.11", features = ["io", "io-util", "compat"] } termcolor = { workspace = true } -termcolor_output = { workspace = true } rand = "0.8.5" wasmparser = { workspace = true } sha2 = { workspace = true } @@ -92,26 +88,20 @@ indexmap = { version = "2.7", features = ["serde"] } itertools = "0.10.5" shlex = "1.1.0" sep5 = { workspace = true } -ethnum = { workspace = true } which = { workspace = true, features = ["regex"] } -strsim = "0.11.1" heck = "0.5.0" tracing = { workspace = true } -tracing-appender = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } cargo_metadata = "0.18.1" pathdiff = "0.2.1" dotenvy = "0.15.7" directories = { workspace = true } ulid = { workspace = true, features = ["serde"] } -strum = "0.17.1" -strum_macros = "0.17.1" async-compression = { version = "0.4.12", features = ["tokio", "gzip"] } shell-escape = "0.1.5" tempfile = "3.8.1" toml_edit = { workspace = true } rust-embed = { version = "8.2.0", features = ["debug-embed"] } -futures-util = "0.3.30" futures = "0.3.30" home = "0.5.9" flate2 = "1.0.30" @@ -119,8 +109,6 @@ bytesize = "1.3.0" humantime = "2.1.0" phf = { version = "0.11.2", features = ["macros"] } semver = "1.0.0" -glob = "0.3.1" -fqdn = "0.3.12" open = "5.3.0" url = "2.5.2" wasm-gen = "0.1.4" @@ -139,14 +127,9 @@ rustix = { version = "1", features = ["process"] } [build-dependencies] crate-git-revision = "0.0.9" -serde.workspace = true -thiserror.workspace = true [dev-dependencies] -assert_cmd = "2.0.4" assert_fs = "1.0.7" -predicates = { workspace = true } -walkdir = "2.5.0" mockito = "1.5.0" serial_test = "3.0.0" diff --git a/cmd/soroban-cli/build.rs b/cmd/soroban-cli/build.rs index c626397536..b6e6dd92a0 100644 --- a/cmd/soroban-cli/build.rs +++ b/cmd/soroban-cli/build.rs @@ -1,14 +1,3 @@ fn main() { crate_git_revision::init(); - set_protocol_features(); -} - -fn set_protocol_features() { - let version = env!("CARGO_PKG_VERSION"); - let _major_version: u32 = version - .split('.') - .next() - .unwrap_or("0") - .parse() - .unwrap_or(0); } diff --git a/cmd/soroban-cli/src/print.rs b/cmd/soroban-cli/src/print.rs index 3b8d65b30b..b6f9dfe7bf 100644 --- a/cmd/soroban-cli/src/print.rs +++ b/cmd/soroban-cli/src/print.rs @@ -88,14 +88,12 @@ impl Print { macro_rules! create_print_functions { ($name:ident, $nameln:ident, $icon:expr) => { impl Print { - #[allow(dead_code)] pub fn $name(&self, message: T) { if !self.quiet { eprint!("{} {}", self.compute_emoji($icon), message); } } - #[allow(dead_code)] pub fn $nameln(&self, message: T) { if !self.quiet { eprintln!("{} {}", self.compute_emoji($icon), message); diff --git a/cmd/soroban-cli/src/utils.rs b/cmd/soroban-cli/src/utils.rs index ddaa959e32..ca04e84a87 100644 --- a/cmd/soroban-cli/src/utils.rs +++ b/cmd/soroban-cli/src/utils.rs @@ -153,7 +153,7 @@ pub fn deprecate_message(print: Print, arg: &str, hint: &str) { } /// Used in tests -#[allow(unused)] +#[cfg(test)] pub(crate) fn parse_secret_key( s: &str, ) -> Result {