From f3a653d25374676ed113a5f9983050f7b808800e Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 6 Feb 2024 12:01:43 -0800 Subject: [PATCH] Revert "[Epic] Separating soroban-rpc to prepare for repo change (#1174)" (#1193) This reverts commit 2581f6298fbf3c5399354032d809ec0fd43735e5. --- Cargo.lock | 497 +++++++++--------- Cargo.toml | 28 +- cmd/crates/soroban-rpc/Cargo.toml | 51 -- cmd/crates/soroban-rpc/README.md | 3 - cmd/crates/soroban-rpc/src/log.rs | 2 - .../soroban-rpc/src/log/diagnostic_events.rs | 11 - cmd/crates/soroban-spec-tools/Cargo.toml | 2 - cmd/crates/soroban-spec-tools/src/lib.rs | 1 - cmd/crates/soroban-test/tests/it/help.rs | 4 +- .../tests/it/integration/dotenv.rs | 7 +- .../tests/it/integration/hello_world.rs | 18 - cmd/crates/soroban-test/tests/it/util.rs | 2 - cmd/soroban-cli/Cargo.toml | 15 +- .../commands/contract/bindings/typescript.rs | 16 +- .../src/commands/contract/extend.rs | 9 +- .../src/commands/contract/inspect.rs | 3 +- .../src/commands/contract/install.rs | 16 +- .../src/commands/contract/invoke.rs | 63 ++- cmd/soroban-cli/src/commands/contract/read.rs | 2 +- .../src/commands/contract/restore.rs | 10 +- cmd/soroban-cli/src/key.rs | 4 +- cmd/soroban-cli/src/lib.rs | 6 +- .../src/rpc}/fixtures/event_response.json | 0 .../src/lib.rs => soroban-cli/src/rpc/mod.rs} | 170 +----- .../src => soroban-cli/src/rpc}/txn.rs | 166 +----- cmd/soroban-cli/src/utils.rs | 57 +- .../src/utils/contract_spec.rs} | 8 +- cmd/soroban-cli/src/wasm.rs | 9 +- docs/soroban-cli-full-docs.md | 203 ------- 29 files changed, 435 insertions(+), 948 deletions(-) delete mode 100644 cmd/crates/soroban-rpc/Cargo.toml delete mode 100644 cmd/crates/soroban-rpc/README.md delete mode 100644 cmd/crates/soroban-rpc/src/log.rs delete mode 100644 cmd/crates/soroban-rpc/src/log/diagnostic_events.rs rename cmd/{crates/soroban-rpc/src => soroban-cli/src/rpc}/fixtures/event_response.json (100%) rename cmd/{crates/soroban-rpc/src/lib.rs => soroban-cli/src/rpc/mod.rs} (92%) rename cmd/{crates/soroban-rpc/src => soroban-cli/src/rpc}/txn.rs (82%) rename cmd/{crates/soroban-spec-tools/src/contract.rs => soroban-cli/src/utils/contract_spec.rs} (98%) diff --git a/Cargo.lock b/Cargo.lock index 54a37d370..8456daacc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arbitrary" @@ -112,14 +112,14 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "assert_cmd" -version = "2.0.13" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00ad3f3a942eee60335ab4342358c161ee296829e0d16ff42fc1d6cb07815467" +checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6" dependencies = [ "anstyle", "bstr", "doc-comment", - "predicates 3.1.0", + "predicates 3.0.4", "predicates-core", "predicates-tree", "wait-timeout", @@ -127,14 +127,14 @@ dependencies = [ [[package]] name = "assert_fs" -version = "1.1.1" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cd762e110c8ed629b11b6cde59458cc1c71de78ebbcc30099fc8e0403a2a2ec" +checksum = "f070617a68e5c2ed5d06ee8dd620ee18fb72b99f6c094bed34cf8ab07c875b48" dependencies = [ "anstyle", "doc-comment", "globwalk", - "predicates 3.1.0", + "predicates 3.0.4", "predicates-core", "predicates-tree", "tempfile", @@ -142,9 +142,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.76" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531b97fb4cd3dfdce92c35dedbfdc1f0b9d8091c8ca943d6dae340ef5012d514" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", @@ -192,9 +192,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.7" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -219,9 +219,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -243,12 +243,12 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.3", "serde", ] @@ -302,9 +302,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" dependencies = [ "serde", ] @@ -341,9 +341,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", @@ -351,14 +351,14 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.48.5", ] [[package]] name = "clap" -version = "4.4.18" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive", @@ -375,9 +375,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", @@ -387,9 +387,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.9" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df631ae429f6613fcd3a7c1adbdb65f637271e561b03680adaa6573015dfb106" +checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae" dependencies = [ "clap", ] @@ -436,9 +436,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "const-oid" -version = "0.9.6" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "core-foundation" @@ -458,9 +458,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -498,37 +498,45 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" dependencies = [ + "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" dependencies = [ + "autocfg", + "cfg-if", "crossbeam-utils", + "memoffset", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +dependencies = [ + "cfg-if", +] [[package]] name = "crypto-bigint" @@ -636,9 +644,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.112" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ab30434ea0ff6aa640a08dda5284026a366d47565496fd40b6cbfbdd7e31a2" +checksum = "7129e341034ecb940c9072817cd9007974ea696844fc4dd582dc1653a7fbe2e8" dependencies = [ "cc", "cxxbridge-flags", @@ -648,9 +656,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.112" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b649d7dfae8268450d53d109388b337b9352c7cba1fc10db4a1bc23c3dc189fb" +checksum = "a2a24f3f5f8eed71936f21e570436f024f5c2e25628f7496aa7ccd03b90109d5" dependencies = [ "cc", "codespan-reporting", @@ -663,15 +671,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.112" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42281b20eba5218c539295c667c18e2f50211bb11902419194c6ed1ae808e547" +checksum = "06fdd177fc61050d63f67f5bd6351fac6ab5526694ea8e359cd9cd3b75857f44" [[package]] name = "cxxbridge-macro" -version = "1.0.112" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45506e3c66512b0a65d291a6b452128b7b1dd9841e20d1e151addbd2c00ea50" +checksum = "587663dd5fb3d10932c8aecfe7c844db1bcf0aee93eeab08fac13dc1212c2e7f" dependencies = [ "proc-macro2", "quote", @@ -731,9 +739,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ "powerfmt", "serde", @@ -1069,18 +1077,18 @@ checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-io" @@ -1090,21 +1098,21 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-core", "futures-io", @@ -1269,7 +1277,7 @@ dependencies = [ "gix-chunk", "gix-features", "gix-hash", - "memmap2 0.9.4", + "memmap2 0.9.3", "thiserror", ] @@ -1296,11 +1304,11 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.4" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e7bfb37a46ed0b8468db37a6d8a0a61d56bdbe4603ae492cb322e5f3958" +checksum = "52e0be46f4cf1f8f9e88d0e3eb7b29718aff23889563249f379119bd1ab6910e" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "bstr", "gix-path", "libc", @@ -1415,7 +1423,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5db19298c5eeea2961e5b3bf190767a2d1f09b8802aeb5f258e42276350aff19" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "bstr", "gix-features", "gix-path", @@ -1460,7 +1468,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c83a4fcc121b2f2e109088f677f89f85e7a8ebf39e8e6659c0ae54d4283b1650" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "bstr", "btoi", "filetime", @@ -1505,7 +1513,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a5cdcf491ecc9ce39dcc227216c540355fe0024ae7c38e94557752ca5ebb67f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "gix-commitgraph", "gix-date", "gix-hash", @@ -1597,9 +1605,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.5" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97e9ad649bf5e109562d6acba657ca428661ec08e77eaf3a755d8fa55485be9c" +checksum = "b8dd0998ab245f33d40ca2267e58d542fe54185ebd1dc41923346cf28d179fb6" dependencies = [ "bstr", "gix-trace", @@ -1614,7 +1622,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dbbb92f75a38ef043c8bb830b339b38d0698d7f3746968b5fcbade7a880494d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "bstr", "gix-attributes", "gix-config-value", @@ -1733,14 +1741,14 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8d9bf462feaf05f2121cba7399dbc6c34d88a9cad58fc1e95027791d6a3c6d2" +checksum = "78f6dce0c6683e2219e8169aac4b1c29e89540a8262fef7056b31d80d969408c" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "gix-path", "libc", - "windows-sys 0.52.0", + "windows", ] [[package]] @@ -1773,9 +1781,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b202d766a7fefc596e2cc6a89cda8ad8ad733aed82da635ac120691112a9b1" +checksum = "e8e1127ede0475b58f4fe9c0aaa0d9bb0bad2af90bbd93ccd307c8632b863d89" [[package]] name = "gix-transport" @@ -1783,7 +1791,7 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f209a93364e24f20319751bc11092272e2f3fe82bb72592b2822679cf5be752" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "bstr", "gix-command", "gix-credentials", @@ -1828,12 +1836,11 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.9" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e839f3d0798b296411263da6bee780a176ef8008a5dfc31287f7eda9266ab8" +checksum = "de6225e2de30b6e9bca2d9f1cc4731640fcef0fb3cabddceee366e7e85d3e94f" dependencies = [ "fastrand", - "unicode-normalization", ] [[package]] @@ -1899,17 +1906,17 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.5", + "regex-automata 0.4.3", "regex-syntax 0.8.2", ] [[package]] name = "globwalk" -version = "0.9.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" dependencies = [ - "bitflags 2.4.2", + "bitflags 1.3.2", "ignore", "walkdir", ] @@ -1927,16 +1934,16 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.11", + "http", "indexmap 2.1.0", "slab", "tokio", @@ -1964,9 +1971,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2004,11 +2011,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -2033,17 +2040,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http-body" version = "0.4.6" @@ -2051,7 +2047,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", + "http", "pin-project-lite", ] @@ -2069,22 +2065,22 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2", - "http 0.2.11", + "http", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -2098,7 +2094,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.11", + "http", "hyper", "log", "rustls", @@ -2122,16 +2118,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.51.1", ] [[package]] @@ -2171,15 +2167,15 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.22" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" dependencies = [ "crossbeam-deque", "globset", "log", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.3", "same-file", "walkdir", "winapi-util", @@ -2249,7 +2245,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.5", "widestring", "windows-sys 0.48.0", "winreg", @@ -2296,9 +2292,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -2372,9 +2368,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] @@ -2396,9 +2392,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libm" @@ -2412,7 +2408,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "libc", "redox_syscall", ] @@ -2434,9 +2430,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -2491,9 +2487,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" @@ -2506,13 +2502,22 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "mime" version = "0.3.17" @@ -2635,9 +2640,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -2656,11 +2661,11 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -2697,9 +2702,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" dependencies = [ "cc", "libc", @@ -2766,18 +2771,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", @@ -2808,15 +2813,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.3.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" +checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "powerfmt" @@ -2846,12 +2851,13 @@ dependencies = [ [[package]] name = "predicates" -version = "3.1.0" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" +checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" dependencies = [ "anstyle", "difflib", + "itertools 0.11.0", "predicates-core", ] @@ -2875,7 +2881,7 @@ dependencies = [ name = "preflight" version = "20.2.0" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "libc", "sha2 0.10.8", "soroban-env-host", @@ -2990,13 +2996,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.3", "regex-syntax 0.8.2", ] @@ -3011,9 +3017,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -3038,13 +3044,13 @@ version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http 0.2.11", + "http", "http-body", "hyper", "hyper-rustls", @@ -3151,11 +3157,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -3192,7 +3198,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", ] [[package]] @@ -3228,11 +3234,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -3326,9 +3332,9 @@ dependencies = [ [[package]] name = "serde-aux" -version = "4.4.0" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86348501c129f3ad50c2f4635a01971f76974cd8a3f335988a0f1581c082765" +checksum = "184eba62ebddb71658697c8b08822edee89970bf318c5362189f0de27f85b498" dependencies = [ "chrono", "serde", @@ -3371,11 +3377,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.5.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5c9fdb6b00a489875b22efd4b78fe2b363b72265cc5f6eb2e2b9ee270e6140c" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "chrono", "hex", "indexmap 1.9.3", @@ -3388,9 +3394,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.5.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbff351eb4b33600a2e138dfa0b10b65a238ea8ff8fb2387c422c5022a3e8298" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" dependencies = [ "darling", "proc-macro2", @@ -3449,9 +3455,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.3.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook-registry" @@ -3500,9 +3506,19 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] [[package]] name = "socket2" @@ -3531,7 +3547,7 @@ version = "20.2.0" dependencies = [ "assert_cmd", "assert_fs", - "base64 0.21.7", + "base64 0.21.5", "cargo_metadata", "chrono", "clap", @@ -3546,7 +3562,7 @@ dependencies = [ "gix", "heck", "hex", - "http 0.2.11", + "http", "hyper", "hyper-tls", "itertools 0.10.5", @@ -3568,7 +3584,6 @@ dependencies = [ "shlex", "soroban-env-host", "soroban-ledger-snapshot", - "soroban-rpc", "soroban-sdk", "soroban-spec", "soroban-spec-json", @@ -3676,38 +3691,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "soroban-rpc" -version = "20.3.0" -dependencies = [ - "base64 0.21.7", - "clap", - "ed25519-dalek 2.0.0", - "ethnum", - "hex", - "http 1.0.0", - "itertools 0.10.5", - "jsonrpsee-core", - "jsonrpsee-http-client", - "serde", - "serde-aux", - "serde_json", - "sha2 0.10.8", - "soroban-env-host", - "soroban-sdk", - "soroban-spec", - "soroban-spec-tools", - "stellar-strkey 0.0.7", - "stellar-xdr", - "termcolor", - "termcolor_output", - "thiserror", - "tokio", - "tracing", - "wasmparser 0.90.0", - "which", -] - [[package]] name = "soroban-sdk" version = "20.3.0" @@ -3802,12 +3785,11 @@ dependencies = [ name = "soroban-spec-tools" version = "20.3.0" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "ethnum", "hex", "itertools 0.10.5", "serde_json", - "soroban-env-host", "soroban-spec", "stellar-strkey 0.0.7", "stellar-xdr", @@ -3821,7 +3803,7 @@ dependencies = [ name = "soroban-spec-typescript" version = "20.3.0" dependencies = [ - "base64 0.21.7", + "base64 0.21.5", "heck", "include_dir", "itertools 0.10.5", @@ -4019,28 +4001,28 @@ dependencies = [ [[package]] name = "temp-dir" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd16aa9ffe15fe021c6ee3766772132c6e98dfa395a167e16864f61a9cfb71d6" +checksum = "af547b166dd1ea4b472165569fc456cfb6818116f854690b0ff205e636523dab" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", "redox_syscall", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -4105,18 +4087,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.55" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3de26b0965292219b4287ff031fcba86837900fe9cd2b34ea8ad893c0953d2" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.55" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", @@ -4135,9 +4117,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", @@ -4157,9 +4139,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4200,9 +4182,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" dependencies = [ "backtrace", "bytes", @@ -4212,7 +4194,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] @@ -4449,9 +4431,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-bom" @@ -4557,9 +4539,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4567,9 +4549,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", @@ -4582,9 +4564,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if", "js-sys", @@ -4594,9 +4576,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4604,9 +4586,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", @@ -4617,9 +4599,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-opt" @@ -4706,9 +4688,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -4770,6 +4752,25 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -4913,9 +4914,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.35" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index aa19bda95..8ba86ea28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,49 +69,27 @@ rev = "4aef54ff9295c2fca4c5b9fbd2c92d0ff99f67de" version = "20.2.0" path = "cmd/soroban-cli" -[workspace.dependencies.soroban-rpc] -version = "20.2.0" -path = "cmd/crates/soroban-rpc" - [workspace.dependencies.stellar-xdr] version = "=20.1.0" default-features = true [workspace.dependencies] -stellar-strkey = "0.0.7" -sep5 = "0.0.2" base64 = "0.21.2" thiserror = "1.0.46" sha2 = "0.10.7" ethnum = "1.3.2" hex = "0.4.3" itertools = "0.10.0" - -serde-aux = "4.1.2" +sep5 = "0.0.2" serde_json = "1.0.82" serde = "1.0.82" - -clap = { version = "4.1.8", features = [ - "derive", - "env", - "deprecated", - "string", -] } -clap_complete = "4.1.4" +stellar-strkey = "0.0.7" tracing = "0.1.37" tracing-subscriber = "0.3.16" tracing-appender = "0.2.2" which = "4.4.0" wasmparser = "0.90.0" -termcolor = "1.1.3" -termcolor_output = "1.0.1" -ed25519-dalek = "2.0.0" - -# networking -http = "1.0.0" -jsonrpsee-http-client = "0.20.1" -jsonrpsee-core = "0.20.1" -tokio = "1.28.1" + # [patch."https://github.com/stellar/rs-soroban-env"] # soroban-env-host = { path = "../rs-soroban-env/soroban-env-host/" } diff --git a/cmd/crates/soroban-rpc/Cargo.toml b/cmd/crates/soroban-rpc/Cargo.toml deleted file mode 100644 index 966597a22..000000000 --- a/cmd/crates/soroban-rpc/Cargo.toml +++ /dev/null @@ -1,51 +0,0 @@ -[package] -name = "soroban-rpc" -description = "Soroban RPC client for rust" -homepage = "https://github.com/stellar/soroban-tools" -repository = "https://github.com/stellar/soroban-tools" -authors = ["Stellar Development Foundation "] -license = "Apache-2.0" -readme = "README.md" -version.workspace = true -edition = "2021" -rust-version.workspace = true -autobins = false - - -[lib] -crate-type = ["rlib"] - - -[dependencies] -soroban-sdk = { version = "=20.3.0", git = "https://github.com/stellar/rs-soroban-sdk", rev = "4aef54ff9295c2fca4c5b9fbd2c92d0ff99f67de" } -soroban-spec-tools = { version = "20.2.0", path = "../soroban-spec-tools" } -soroban-env-host = { version = "=20.2.0", git = "https://github.com/stellar/rs-soroban-env", rev = "1bfc0f2a2ee134efc1e1b0d5270281d0cba61c2e" } -stellar-strkey = "0.0.7" -stellar-xdr = { version = "=20.1.0", default-features = true, features = ["curr", "std", "serde"] } -soroban-spec = { version = "=20.3.0", git = "https://github.com/stellar/rs-soroban-sdk", rev = "4aef54ff9295c2fca4c5b9fbd2c92d0ff99f67de" } - -termcolor = "1.1.3" -termcolor_output = "1.0.1" -clap = { version = "4.1.8", features = ["derive", "env", "deprecated", "string"] } -serde_json = "1.0.82" -serde-aux = "4.1.2" -itertools = "0.10.0" -ethnum = "1.3.2" -hex = "0.4.3" -wasmparser = "0.90.0" -base64 = "0.21.2" -thiserror = "1.0.46" -serde = "1.0.82" -tokio = "1.28.1" -sha2 = "0.10.7" -ed25519-dalek = "2.0.0" -tracing = "0.1.40" - -# networking -jsonrpsee-http-client = "0.20.1" -jsonrpsee-core = "0.20.1" -http = "1.0.0" - - -[dev-dependencies] -which = "4.4.0" diff --git a/cmd/crates/soroban-rpc/README.md b/cmd/crates/soroban-rpc/README.md deleted file mode 100644 index 9185b7fd0..000000000 --- a/cmd/crates/soroban-rpc/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# soroban-rpc - -Tools and utilities for soroban rpc. diff --git a/cmd/crates/soroban-rpc/src/log.rs b/cmd/crates/soroban-rpc/src/log.rs deleted file mode 100644 index 361268148..000000000 --- a/cmd/crates/soroban-rpc/src/log.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod diagnostic_events; -pub use diagnostic_events::*; diff --git a/cmd/crates/soroban-rpc/src/log/diagnostic_events.rs b/cmd/crates/soroban-rpc/src/log/diagnostic_events.rs deleted file mode 100644 index 68af67a4e..000000000 --- a/cmd/crates/soroban-rpc/src/log/diagnostic_events.rs +++ /dev/null @@ -1,11 +0,0 @@ -pub fn diagnostic_events(events: &[impl std::fmt::Debug], level: tracing::Level) { - for (i, event) in events.iter().enumerate() { - if level == tracing::Level::TRACE { - tracing::trace!("{i}: {event:#?}"); - } else if level == tracing::Level::INFO { - tracing::info!("{i}: {event:#?}"); - } else if level == tracing::Level::ERROR { - tracing::error!("{i}: {event:#?}"); - } - } -} diff --git a/cmd/crates/soroban-spec-tools/Cargo.toml b/cmd/crates/soroban-spec-tools/Cargo.toml index 514b82924..61a32c137 100644 --- a/cmd/crates/soroban-spec-tools/Cargo.toml +++ b/cmd/crates/soroban-spec-tools/Cargo.toml @@ -20,8 +20,6 @@ crate-type = ["rlib"] soroban-spec = { workspace = true } stellar-strkey = { workspace = true } stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] } -soroban-env-host = { workspace = true } - serde_json = { workspace = true } itertools = { workspace = true } ethnum = { workspace = true } diff --git a/cmd/crates/soroban-spec-tools/src/lib.rs b/cmd/crates/soroban-spec-tools/src/lib.rs index bc3c2a386..7f310fd99 100644 --- a/cmd/crates/soroban-spec-tools/src/lib.rs +++ b/cmd/crates/soroban-spec-tools/src/lib.rs @@ -13,7 +13,6 @@ use stellar_xdr::curr::{ UInt128Parts, UInt256Parts, Uint256, VecM, }; -pub mod contract; pub mod utils; #[derive(thiserror::Error, Debug)] diff --git a/cmd/crates/soroban-test/tests/it/help.rs b/cmd/crates/soroban-test/tests/it/help.rs index a66c449ed..6d4680e77 100644 --- a/cmd/crates/soroban-test/tests/it/help.rs +++ b/cmd/crates/soroban-test/tests/it/help.rs @@ -1,11 +1,11 @@ use soroban_cli::commands::contract; use soroban_test::TestEnv; -use crate::util::{invoke_custom as invoke, CUSTOM_TYPES, DEFAULT_CONTRACT_ID}; +use crate::util::{invoke_custom as invoke, CUSTOM_TYPES}; async fn invoke_custom(func: &str, args: &str) -> Result { let e = &TestEnv::default(); - invoke(e, DEFAULT_CONTRACT_ID, func, args, &CUSTOM_TYPES.path()).await + invoke(e, "1", func, args, &CUSTOM_TYPES.path()).await } #[tokio::test] diff --git a/cmd/crates/soroban-test/tests/it/integration/dotenv.rs b/cmd/crates/soroban-test/tests/it/integration/dotenv.rs index 7c0f25b3f..d7d56aaf3 100644 --- a/cmd/crates/soroban-test/tests/it/integration/dotenv.rs +++ b/cmd/crates/soroban-test/tests/it/integration/dotenv.rs @@ -35,7 +35,7 @@ fn current_env_not_overwritten() { write_env_file(e, &contract_id()); e.new_assert_cmd("contract") - .env("SOROBAN_CONTRACT_ID", "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4") + .env("SOROBAN_CONTRACT_ID", "2") .arg("invoke") .arg("--") .arg("hello") @@ -51,10 +51,7 @@ fn cli_args_have_priority() { deploy_hello(e); write_env_file(e, &contract_id()); e.new_assert_cmd("contract") - .env( - "SOROBAN_CONTRACT_ID", - "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", - ) + .env("SOROBAN_CONTRACT_ID", "2") .arg("invoke") .arg("--id") .arg(TEST_CONTRACT_ID) diff --git a/cmd/crates/soroban-test/tests/it/integration/hello_world.rs b/cmd/crates/soroban-test/tests/it/integration/hello_world.rs index 7bd8d596a..7714f70dd 100644 --- a/cmd/crates/soroban-test/tests/it/integration/hello_world.rs +++ b/cmd/crates/soroban-test/tests/it/integration/hello_world.rs @@ -1,4 +1,3 @@ -use predicates::boolean::PredicateBooleanExt; use soroban_cli::commands::{ contract::{self, fetch}, keys, @@ -20,23 +19,7 @@ async fn invoke() { extend_contract(sandbox, id, HELLO_WORLD).await; // Note that all functions tested here have no state invoke_hello_world(sandbox, id); - sandbox - .new_assert_cmd("events") - .arg("--start-ledger=20") - .arg("--id") - .arg(id) - .assert() - .stdout(predicates::str::contains(id).not()) - .success(); invoke_hello_world_with_lib(sandbox, id).await; - sandbox - .new_assert_cmd("events") - .arg("--start-ledger=20") - .arg("--id") - .arg(id) - .assert() - .stdout(predicates::str::contains(id)) - .success(); invoke_hello_world_with_lib_two(sandbox, id).await; invoke_auth(sandbox, id); invoke_auth_with_identity(sandbox, id).await; @@ -56,7 +39,6 @@ fn invoke_hello_world(sandbox: &TestEnv, id: &str) { sandbox .new_assert_cmd("contract") .arg("invoke") - .arg("--is-view") .arg("--id") .arg(id) .arg("--") diff --git a/cmd/crates/soroban-test/tests/it/util.rs b/cmd/crates/soroban-test/tests/it/util.rs index 112d5f841..6d6251012 100644 --- a/cmd/crates/soroban-test/tests/it/util.rs +++ b/cmd/crates/soroban-test/tests/it/util.rs @@ -68,5 +68,3 @@ pub async fn invoke_custom( i.invoke(&soroban_cli::commands::global::Args::default()) .await } - -pub const DEFAULT_CONTRACT_ID: &str = "CDR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OO5Z"; diff --git a/cmd/soroban-cli/Cargo.toml b/cmd/soroban-cli/Cargo.toml index ea936d941..f402b5ba3 100644 --- a/cmd/soroban-cli/Cargo.toml +++ b/cmd/soroban-cli/Cargo.toml @@ -45,27 +45,24 @@ soroban-spec-typescript = { workspace = true } soroban-ledger-snapshot = { workspace = true } stellar-strkey = { workspace = true } soroban-sdk = { workspace = true } -soroban-rpc = { workspace = true } - -clap = { workspace = true, features = [ +clap = { version = "4.1.8", features = [ "derive", "env", "deprecated", "string", ] } -clap_complete = {workspace = true} - base64 = { workspace = true } thiserror = { workspace = true } serde = "1.0.82" serde_derive = "1.0.82" serde_json = "1.0.82" -serde-aux = { workspace = true } +serde-aux = "4.1.2" hex = { workspace = true } num-bigint = "0.4" tokio = { version = "1", features = ["full"] } -termcolor = { workspace = true } -termcolor_output = { workspace = true } +termcolor = "1.1.3" +termcolor_output = "1.0.1" +clap_complete = "4.1.4" rand = "0.8.5" wasmparser = { workspace = true } sha2 = { workspace = true } @@ -73,7 +70,7 @@ csv = "1.1.6" ed25519-dalek = "=2.0.0" jsonrpsee-http-client = "0.20.1" jsonrpsee-core = "0.20.1" -hyper = "0.14.27" +hyper = "0.14.27" hyper-tls = "0.5" http = "0.2.9" regex = "1.6.0" diff --git a/cmd/soroban-cli/src/commands/contract/bindings/typescript.rs b/cmd/soroban-cli/src/commands/contract/bindings/typescript.rs index 091f8255a..19c7eecd6 100644 --- a/cmd/soroban-cli/src/commands/contract/bindings/typescript.rs +++ b/cmd/soroban-cli/src/commands/contract/bindings/typescript.rs @@ -1,15 +1,17 @@ use std::{ffi::OsString, fmt::Debug, path::PathBuf}; use clap::{command, Parser}; -use soroban_spec_tools::contract as contract_spec; use soroban_spec_typescript::{self as typescript, boilerplate::Project}; -use crate::commands::{ - config::locator, - contract::{self, fetch}, - network::{self, Network}, -}; use crate::wasm; +use crate::{ + commands::{ + config::locator, + contract::{self, fetch}, + network::{self, Network}, + }, + utils::contract_spec::{self, ContractSpec}, +}; #[derive(Parser, Debug, Clone)] #[group(skip)] @@ -76,7 +78,7 @@ impl Cmd { network: self.network.clone(), }; let bytes = fetch.get_bytes().await?; - contract_spec::Spec::new(&bytes)?.spec + ContractSpec::new(&bytes)?.spec }; if self.output_dir.is_file() { return Err(Error::IsFile(self.output_dir.clone())); diff --git a/cmd/soroban-cli/src/commands/contract/extend.rs b/cmd/soroban-cli/src/commands/contract/extend.rs index 86ea23b55..7e9f1e98c 100644 --- a/cmd/soroban-cli/src/commands/contract/extend.rs +++ b/cmd/soroban-cli/src/commands/contract/extend.rs @@ -144,18 +144,15 @@ impl Cmd { }), }; - let res = client + let (result, meta, events) = client .prepare_and_send_transaction(&tx, &key, &[], &network.network_passphrase, None, None) .await?; - let events = res.events()?; + tracing::trace!(?result); + tracing::trace!(?meta); if !events.is_empty() { tracing::info!("Events:\n {events:#?}"); } - let meta = res - .result_meta - .as_ref() - .ok_or(Error::MissingOperationResult)?; // The transaction from core will succeed regardless of whether it actually found & extended // the entry, so we have to inspect the result meta to tell if it worked or not. diff --git a/cmd/soroban-cli/src/commands/contract/inspect.rs b/cmd/soroban-cli/src/commands/contract/inspect.rs index e66bf83fd..355c18ca8 100644 --- a/cmd/soroban-cli/src/commands/contract/inspect.rs +++ b/cmd/soroban-cli/src/commands/contract/inspect.rs @@ -1,6 +1,5 @@ use clap::{command, Parser}; use soroban_env_host::xdr; -use soroban_spec_tools::contract; use std::{fmt::Debug, path::PathBuf}; use tracing::debug; @@ -29,7 +28,7 @@ pub enum Error { #[error(transparent)] Xdr(#[from] xdr::Error), #[error(transparent)] - Spec(#[from] contract::Error), + Spec(#[from] crate::utils::contract_spec::Error), } impl Cmd { diff --git a/cmd/soroban-cli/src/commands/contract/install.rs b/cmd/soroban-cli/src/commands/contract/install.rs index c2fa6d889..905775298 100644 --- a/cmd/soroban-cli/src/commands/contract/install.rs +++ b/cmd/soroban-cli/src/commands/contract/install.rs @@ -112,10 +112,14 @@ impl Cmd { build_install_contract_code_tx(contract, sequence + 1, self.fee.fee, &key)?; // Currently internal errors are not returned if the contract code is expired - if let Some(TransactionResult { - result: TransactionResultResult::TxInternalError, - .. - }) = client + if let ( + TransactionResult { + result: TransactionResultResult::TxInternalError, + .. + }, + _, + _, + ) = client .prepare_and_send_transaction( &tx_without_preflight, &key, @@ -125,8 +129,6 @@ impl Cmd { None, ) .await? - .result - .as_ref() { // Now just need to restore it and don't have to install again restore::Cmd { @@ -151,7 +153,7 @@ impl Cmd { } } -fn get_contract_meta_sdk_version(wasm_spec: &soroban_spec_tools::contract::Spec) -> Option { +fn get_contract_meta_sdk_version(wasm_spec: &utils::contract_spec::ContractSpec) -> Option { let rs_sdk_version_option = if let Some(_meta) = &wasm_spec.meta_base64 { wasm_spec.meta.iter().find(|entry| match entry { ScMetaEntry::ScMetaV0(ScMetaV0 { key, .. }) => { diff --git a/cmd/soroban-cli/src/commands/contract/invoke.rs b/cmd/soroban-cli/src/commands/contract/invoke.rs index 720c3c6f8..669342b06 100644 --- a/cmd/soroban-cli/src/commands/contract/invoke.rs +++ b/cmd/soroban-cli/src/commands/contract/invoke.rs @@ -28,8 +28,13 @@ use super::super::{ config::{self, locator}, events, }; -use crate::{commands::global, rpc, Pwd}; -use soroban_spec_tools::{contract, Spec}; +use crate::{ + commands::global, + rpc::{self, Client}, + utils::{self, contract_spec}, + Pwd, +}; +use soroban_spec_tools::Spec; #[derive(Parser, Debug, Default, Clone)] #[allow(clippy::struct_excessive_bools)] @@ -44,12 +49,6 @@ pub struct Cmd { /// Output the cost execution to stderr #[arg(long = "cost")] pub cost: bool, - /// Number of instructions to simulate - #[arg(long)] - pub instructions: Option, - /// Do not sign and submit transaction - #[arg(long, env = "SOROBAN_INVOKE_SIGN", env = "SYSTEM_TEST_VERBOSE_OUTPUT")] - pub is_view: bool, /// Function name as subcommand, then arguments for that function as `--arg-name value` #[arg(last = true, id = "CONTRACT_FN_AND_ARGS")] pub slop: Vec, @@ -141,7 +140,7 @@ pub enum Error { #[error(transparent)] StrKey(#[from] stellar_strkey::DecodeError), #[error(transparent)] - ContractSpec(#[from] contract::Error), + ContractSpec(#[from] contract_spec::Error), #[error("")] MissingFileArg(PathBuf), } @@ -276,7 +275,7 @@ impl Cmd { // For testing wasm arg parsing let _ = self.build_host_function_parameters(contract_id, spec_entries)?; } - let client = rpc::Client::new(&network.rpc_url)?; + let client = Client::new(&network.rpc_url)?; client .verify_network_passphrase(Some(&network.network_passphrase)) .await?; @@ -300,31 +299,29 @@ impl Cmd { self.fee.fee, &key, )?; - let mut txn = client.create_assembled_transaction(&tx).await?; - if let Some(instructions) = self.instructions { - txn = txn.set_max_instructions(instructions); - } - let (return_value, events) = if self.is_view { - ( - txn.sim_response().results()?[0].xdr.clone(), - txn.sim_response().events()?, + + let (result, meta, events) = client + .prepare_and_send_transaction( + &tx, + &key, + &signers, + &network.network_passphrase, + Some(log_events), + (global_args.verbose || global_args.very_verbose || self.cost) + .then_some(log_resources), ) - } else { - let res = client - .send_assembled_transaction( - txn, - &key, - &signers, - &network.network_passphrase, - Some(log_events), - (global_args.verbose || global_args.very_verbose || self.cost) - .then_some(log_resources), - ) - .await?; - (res.return_value()?, res.contract_events()?) - }; + .await?; + tracing::debug!(?result); crate::log::diagnostic_events(&events, tracing::Level::INFO); + let xdr::TransactionMeta::V3(xdr::TransactionMetaV3 { + soroban_meta: Some(xdr::SorobanTransactionMeta { return_value, .. }), + .. + }) = meta + else { + return Err(Error::MissingOperationResult); + }; + output_to_string(&spec, &return_value, &function) } @@ -347,7 +344,7 @@ impl Cmd { impl Cmd { fn contract_id(&self) -> Result<[u8; 32], Error> { - soroban_spec_tools::utils::contract_id_from_str(&self.contract_id) + utils::contract_id_from_str(&self.contract_id) .map_err(|e| Error::CannotParseContractId(self.contract_id.clone(), e)) } } diff --git a/cmd/soroban-cli/src/commands/contract/read.rs b/cmd/soroban-cli/src/commands/contract/read.rs index f25b6c2c0..842832d5f 100644 --- a/cmd/soroban-cli/src/commands/contract/read.rs +++ b/cmd/soroban-cli/src/commands/contract/read.rs @@ -120,7 +120,7 @@ impl Cmd { let ( LedgerKey::ContractData(LedgerKeyContractData { key, .. }), LedgerEntryData::ContractData(ContractDataEntry { val, .. }), - ) = &(key, val) + ) = (key, val) else { return Err(Error::OnlyDataAllowed); }; diff --git a/cmd/soroban-cli/src/commands/contract/restore.rs b/cmd/soroban-cli/src/commands/contract/restore.rs index 6ed39f892..38b8a84a1 100644 --- a/cmd/soroban-cli/src/commands/contract/restore.rs +++ b/cmd/soroban-cli/src/commands/contract/restore.rs @@ -148,15 +148,11 @@ impl Cmd { }), }; - let res = client + let (result, meta, events) = client .prepare_and_send_transaction(&tx, &key, &[], &network.network_passphrase, None, None) .await?; - let meta = res - .result_meta - .as_ref() - .ok_or(Error::MissingOperationResult)?; - let events = res.events()?; + tracing::trace!(?result); tracing::trace!(?meta); if !events.is_empty() { tracing::info!("Events:\n {events:#?}"); @@ -181,7 +177,7 @@ impl Cmd { operations[0].changes.len() ); } - parse_operations(operations).ok_or(Error::MissingOperationResult) + parse_operations(&operations).ok_or(Error::MissingOperationResult) } } diff --git a/cmd/soroban-cli/src/key.rs b/cmd/soroban-cli/src/key.rs index 2290e857e..e9901abd2 100644 --- a/cmd/soroban-cli/src/key.rs +++ b/cmd/soroban-cli/src/key.rs @@ -59,7 +59,7 @@ pub struct Args { )] pub wasm_hash: Option, /// Storage entry durability - #[arg(long, value_enum, required = true, default_value = "persistent")] + #[arg(long, value_enum, required = true)] pub durability: Durability, } @@ -83,7 +83,7 @@ impl Args { } else if let Some(wasm_hash) = &self.wasm_hash { return Ok(vec![LedgerKey::ContractCode(LedgerKeyContractCode { hash: xdr::Hash( - soroban_spec_tools::utils::contract_id_from_str(wasm_hash) + utils::contract_id_from_str(wasm_hash) .map_err(|e| Error::CannotParseContractId(wasm_hash.clone(), e))?, ), })]); diff --git a/cmd/soroban-cli/src/lib.rs b/cmd/soroban-cli/src/lib.rs index ef443853b..3aad487c8 100644 --- a/cmd/soroban-cli/src/lib.rs +++ b/cmd/soroban-cli/src/lib.rs @@ -3,17 +3,17 @@ clippy::must_use_candidate, clippy::missing_panics_doc )] -pub(crate) use soroban_rpc as rpc; -use std::path::Path; - pub mod commands; pub mod fee; pub mod key; pub mod log; +pub mod rpc; pub mod toid; pub mod utils; pub mod wasm; +use std::path::Path; + pub use commands::Root; pub fn parse_cmd(s: &str) -> Result diff --git a/cmd/crates/soroban-rpc/src/fixtures/event_response.json b/cmd/soroban-cli/src/rpc/fixtures/event_response.json similarity index 100% rename from cmd/crates/soroban-rpc/src/fixtures/event_response.json rename to cmd/soroban-cli/src/rpc/fixtures/event_response.json diff --git a/cmd/crates/soroban-rpc/src/lib.rs b/cmd/soroban-cli/src/rpc/mod.rs similarity index 92% rename from cmd/crates/soroban-rpc/src/lib.rs rename to cmd/soroban-cli/src/rpc/mod.rs index 95c3692e1..535426292 100644 --- a/cmd/crates/soroban-rpc/src/lib.rs +++ b/cmd/soroban-cli/src/rpc/mod.rs @@ -21,20 +21,15 @@ use std::{ str::FromStr, time::{Duration, Instant}, }; -use stellar_xdr::curr::ContractEventType; use termcolor::{Color, ColorChoice, StandardStream, WriteColor}; use termcolor_output::colored; use tokio::time::sleep; -pub mod log; -mod txn; - -pub use txn::Assembled; +use crate::utils::contract_spec; -use soroban_spec_tools::contract; +mod txn; const VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION"); -pub(crate) const DEFAULT_TRANSACTION_FEES: u32 = 100; pub type LogEvents = fn( footprint: &LedgerFootprint, @@ -93,7 +88,7 @@ pub enum Error { #[error("unexpected contract code data type: {0:?}")] UnexpectedContractCodeDataType(LedgerEntryData), #[error(transparent)] - CouldNotParseContractSpec(#[from] contract::Error), + CouldNotParseContractSpec(#[from] contract_spec::Error), #[error("unexpected contract code got token")] UnexpectedToken(ContractDataEntry), #[error(transparent)] @@ -104,9 +99,6 @@ pub enum Error { LargeFee(u64), #[error("Cannot authorize raw transactions")] CannotAuthorizeRawTransaction, - - #[error("Missing result for tnx")] - MissingOp, } #[derive(serde::Deserialize, serde::Serialize, Debug)] @@ -178,41 +170,6 @@ impl TryInto for GetTransactionResponseRaw { } } -impl GetTransactionResponse { - /// - /// # Errors - pub fn return_value(&self) -> Result { - if let Some(xdr::TransactionMeta::V3(xdr::TransactionMetaV3 { - soroban_meta: Some(xdr::SorobanTransactionMeta { return_value, .. }), - .. - })) = &self.result_meta - { - Ok(return_value.clone()) - } else { - Err(Error::MissingOp) - } - } - - /// - /// # Errors - pub fn events(&self) -> Result, Error> { - self.result_meta - .as_ref() - .map(extract_events) - .ok_or(Error::MissingOp) - } - - /// - /// # Errors - pub fn contract_events(&self) -> Result, Error> { - Ok(self - .events()? - .into_iter() - .filter(|e| matches!(e.event.type_, ContractEventType::Contract)) - .collect::>()) - } -} - #[derive(serde::Deserialize, serde::Serialize, Debug)] pub struct LedgerEntryResult { pub key: String, @@ -316,8 +273,6 @@ pub struct SimulateTransactionResponse { } impl SimulateTransactionResponse { - /// - /// # Errors pub fn results(&self) -> Result, Error> { self.results .iter() @@ -339,8 +294,6 @@ impl SimulateTransactionResponse { .collect() } - /// - /// # Errors pub fn events(&self) -> Result, Error> { self.events .iter() @@ -348,8 +301,6 @@ impl SimulateTransactionResponse { .collect() } - /// - /// # Errors pub fn transaction_data(&self) -> Result { Ok(SorobanTransactionData::from_xdr_base64( &self.transaction_data, @@ -392,7 +343,6 @@ pub struct GetEventsResponse { // Reference](https://docs.google.com/document/d/1TZUDgo_3zPz7TiPMMHVW_mtogjLyPL0plvzGMsxSz6A/edit#bookmark=id.35t97rnag3tx) // [Code // Reference](https://github.com/stellar/soroban-tools/blob/bac1be79e8c2590c9c35ad8a0168aab0ae2b4171/cmd/soroban-rpc/internal/methods/get_events.go#L182-L203) -#[must_use] pub fn does_topic_match(topic: &[String], filter: &[String]) -> bool { filter.len() == topic.len() && filter @@ -447,13 +397,10 @@ impl Display for Event { } impl Event { - /// - /// # Errors pub fn parse_cursor(&self) -> Result<(u64, i32), Error> { parse_cursor(&self.id) } - /// - /// # Errors + pub fn pretty_print(&self) -> Result<(), Box> { let mut stdout = StandardStream::stdout(ColorChoice::Auto); if !stdout.supports_color() { @@ -555,8 +502,6 @@ pub struct Client { } impl Client { - /// - /// # Errors pub fn new(base_url: &str) -> Result { // Add the port to the base URL if there is no port explicitly included // in the URL and the scheme allows us to infer a default port. @@ -587,8 +532,6 @@ impl Client { }) } - /// - /// # Errors fn client(&self) -> Result { let url = self.base_url.clone(); let mut headers = HeaderMap::new(); @@ -600,8 +543,6 @@ impl Client { .build(url)?) } - /// - /// # Errors pub async fn friendbot_url(&self) -> Result { let network = self.get_network().await?; tracing::trace!("{network:#?}"); @@ -612,8 +553,7 @@ impl Client { ) }) } - /// - /// # Errors + pub async fn verify_network_passphrase(&self, expected: Option<&str>) -> Result { let server = self.get_network().await?.passphrase; if let Some(expected) = expected { @@ -627,15 +567,11 @@ impl Client { Ok(server) } - /// - /// # Errors pub async fn get_network(&self) -> Result { tracing::trace!("Getting network"); Ok(self.client()?.request("getNetwork", rpc_params![]).await?) } - /// - /// # Errors pub async fn get_latest_ledger(&self) -> Result { tracing::trace!("Getting latest ledger"); Ok(self @@ -644,8 +580,6 @@ impl Client { .await?) } - /// - /// # Errors pub async fn get_account(&self, address: &str) -> Result { tracing::trace!("Getting address {}", address); let key = LedgerKey::Account(LedgerKeyAccount { @@ -677,12 +611,10 @@ soroban config identity fund {address} --helper-url "# } } - /// - /// # Errors pub async fn send_transaction( &self, tx: &TransactionEnvelope, - ) -> Result { + ) -> Result<(TransactionResult, TransactionMeta, Vec), Error> { let client = self.client()?; tracing::trace!("Sending:\n{tx:#?}"); let SendTransactionResponse { @@ -724,8 +656,14 @@ soroban config identity fund {address} --helper-url "# "SUCCESS" => { // TODO: the caller should probably be printing this tracing::trace!("{response:#?}"); - - return Ok(response); + let GetTransactionResponse { + result, + result_meta, + .. + } = response; + let meta = result_meta.ok_or(Error::MissingResult)?; + let events = extract_events(&meta); + return Ok((result.ok_or(Error::MissingResult)?, meta, events)); } "FAILED" => { tracing::error!("{response:#?}"); @@ -749,8 +687,6 @@ soroban config identity fund {address} --helper-url "# } } - /// - /// # Errors pub async fn simulate_transaction( &self, tx: &TransactionEnvelope, @@ -767,69 +703,33 @@ soroban config identity fund {address} --helper-url "# match response.error { None => Ok(response), Some(e) => { - log::diagnostic_events(&response.events, tracing::Level::ERROR); + crate::log::diagnostic_events(&response.events, tracing::Level::ERROR); Err(Error::TransactionSimulationFailed(e)) } } } - /// - /// # Errors - pub async fn send_assembled_transaction( + pub async fn prepare_and_send_transaction( &self, - txn: txn::Assembled, + tx_without_preflight: &Transaction, source_key: &ed25519_dalek::SigningKey, signers: &[ed25519_dalek::SigningKey], network_passphrase: &str, log_events: Option, log_resources: Option, - ) -> Result { - let seq_num = txn.sim_response().latest_ledger + 60; //5 min; + ) -> Result<(TransactionResult, TransactionMeta, Vec), Error> { + let txn = txn::Assembled::new(tx_without_preflight, self).await?; + let seq_num = txn.sim_res().latest_ledger + 60; //5 min; let authorized = txn .handle_restore(self, source_key, network_passphrase) .await? .authorize(self, source_key, signers, seq_num, network_passphrase) .await?; authorized.log(log_events, log_resources)?; - let tx = authorized.sign(source_key, network_passphrase)?; self.send_transaction(&tx).await } - /// - /// # Errors - pub async fn prepare_and_send_transaction( - &self, - tx_without_preflight: &Transaction, - source_key: &ed25519_dalek::SigningKey, - signers: &[ed25519_dalek::SigningKey], - network_passphrase: &str, - log_events: Option, - log_resources: Option, - ) -> Result { - let txn = txn::Assembled::new(tx_without_preflight, self).await?; - self.send_assembled_transaction( - txn, - source_key, - signers, - network_passphrase, - log_events, - log_resources, - ) - .await - } - - /// - /// # Errors - pub async fn create_assembled_transaction( - &self, - txn: &Transaction, - ) -> Result { - txn::Assembled::new(txn, self).await - } - - /// - /// # Errors pub async fn get_transaction(&self, tx_id: &str) -> Result { Ok(self .client()? @@ -837,8 +737,6 @@ soroban config identity fund {address} --helper-url "# .await?) } - /// - /// # Errors pub async fn get_ledger_entries( &self, keys: &[LedgerKey], @@ -849,7 +747,7 @@ soroban config identity fund {address} --helper-url "# if base64_result.is_err() { return Err(Error::Xdr(XdrError::Invalid)); } - base64_keys.push(k.to_xdr_base64(Limits::none())?); + base64_keys.push(k.to_xdr_base64(Limits::none()).unwrap()); } Ok(self .client()? @@ -857,8 +755,6 @@ soroban config identity fund {address} --helper-url "# .await?) } - /// - /// # Errors pub async fn get_full_ledger_entries( &self, ledger_keys: &[LedgerKey], @@ -899,8 +795,7 @@ soroban config identity fund {address} --helper-url "# latest_ledger, }) } - /// - /// # Errors + pub async fn get_events( &self, start: EventStart, @@ -940,8 +835,6 @@ soroban config identity fund {address} --helper-url "# Ok(self.client()?.request("getEvents", oparams).await?) } - /// - /// # Errors pub async fn get_contract_data( &self, contract_id: &[u8; 32], @@ -965,8 +858,6 @@ soroban config identity fund {address} --helper-url "# } } - /// - /// # Errors pub async fn get_remote_wasm(&self, contract_id: &[u8; 32]) -> Result, Error> { match self.get_contract_data(contract_id).await? { xdr::ContractDataEntry { @@ -981,8 +872,6 @@ soroban config identity fund {address} --helper-url "# } } - /// - /// # Errors pub async fn get_remote_wasm_from_hash(&self, hash: xdr::Hash) -> Result, Error> { let code_key = LedgerKey::ContractCode(xdr::LedgerKeyContractCode { hash: hash.clone() }); let contract_data = self.get_ledger_entries(&[code_key]).await?; @@ -999,8 +888,7 @@ soroban config identity fund {address} --helper-url "# scval => Err(Error::UnexpectedContractCodeDataType(scval)), } } - /// - /// # Errors + pub async fn get_remote_contract_spec( &self, contract_id: &[u8; 32], @@ -1010,11 +898,11 @@ soroban config identity fund {address} --helper-url "# xdr::ScVal::ContractInstance(xdr::ScContractInstance { executable: xdr::ContractExecutable::Wasm(hash), .. - }) => Ok( - contract::Spec::new(&self.get_remote_wasm_from_hash(hash).await?) - .map_err(Error::CouldNotParseContractSpec)? - .spec, - ), + }) => Ok(contract_spec::ContractSpec::new( + &self.get_remote_wasm_from_hash(hash).await?, + ) + .map_err(Error::CouldNotParseContractSpec)? + .spec), xdr::ScVal::ContractInstance(xdr::ScContractInstance { executable: xdr::ContractExecutable::StellarAsset, .. @@ -1051,7 +939,7 @@ fn extract_events(tx_meta: &TransactionMeta) -> Vec { } } -pub(crate) fn parse_cursor(c: &str) -> Result<(u64, i32), Error> { +pub fn parse_cursor(c: &str) -> Result<(u64, i32), Error> { let (toid_part, event_index) = c.split('-').collect_tuple().ok_or(Error::InvalidCursor)?; let toid_part: u64 = toid_part.parse().map_err(|_| Error::InvalidCursor)?; let start_index: i32 = event_index.parse().map_err(|_| Error::InvalidCursor)?; diff --git a/cmd/crates/soroban-rpc/src/txn.rs b/cmd/soroban-cli/src/rpc/txn.rs similarity index 82% rename from cmd/crates/soroban-rpc/src/txn.rs rename to cmd/soroban-cli/src/rpc/txn.rs index 35b0c7192..9e36938dd 100644 --- a/cmd/crates/soroban-rpc/src/txn.rs +++ b/cmd/soroban-cli/src/rpc/txn.rs @@ -2,16 +2,16 @@ use ed25519_dalek::Signer; use sha2::{Digest, Sha256}; use soroban_env_host::xdr::{ self, AccountId, DecoratedSignature, ExtensionPoint, Hash, HashIdPreimage, - HashIdPreimageSorobanAuthorization, InvokeHostFunctionOp, LedgerFootprint, Limits, Memo, - Operation, OperationBody, Preconditions, PublicKey, ReadXdr, RestoreFootprintOp, ScAddress, - ScMap, ScSymbol, ScVal, Signature, SignatureHint, SorobanAddressCredentials, + HashIdPreimageSorobanAuthorization, InvokeHostFunctionOp, Limits, Memo, Operation, + OperationBody, Preconditions, PublicKey, ReadXdr, RestoreFootprintOp, ScAddress, ScMap, + ScSymbol, ScVal, Signature, SignatureHint, SorobanAddressCredentials, SorobanAuthorizationEntry, SorobanAuthorizedFunction, SorobanCredentials, SorobanResources, SorobanTransactionData, Transaction, TransactionEnvelope, TransactionExt, TransactionSignaturePayload, TransactionSignaturePayloadTaggedTransaction, TransactionV1Envelope, Uint256, VecM, WriteXdr, }; -use super::{Client, Error, RestorePreamble, SimulateTransactionResponse}; +use crate::rpc::{Client, Error, RestorePreamble, SimulateTransactionResponse}; use super::{LogEvents, LogResources}; @@ -20,35 +20,13 @@ pub struct Assembled { sim_res: SimulateTransactionResponse, } -/// Represents an assembled transaction ready to be signed and submitted to the network. impl Assembled { - /// - /// Creates a new `Assembled` transaction. - /// - /// # Arguments - /// - /// * `txn` - The original transaction. - /// * `client` - The client used for simulation and submission. - /// - /// # Errors - /// - /// Returns an error if simulation fails or if assembling the transaction fails. pub async fn new(txn: &Transaction, client: &Client) -> Result { let sim_res = Self::simulate(txn, client).await?; let txn = assemble(txn, &sim_res)?; Ok(Self { txn, sim_res }) } - /// - /// Calculates the hash of the assembled transaction. - /// - /// # Arguments - /// - /// * `network_passphrase` - The network passphrase. - /// - /// # Errors - /// - /// Returns an error if generating the hash fails. pub fn hash(&self, network_passphrase: &str) -> Result<[u8; 32], xdr::Error> { let signature_payload = TransactionSignaturePayload { network_id: Hash(Sha256::digest(network_passphrase).into()), @@ -57,23 +35,12 @@ impl Assembled { Ok(Sha256::digest(signature_payload.to_xdr(Limits::none())?).into()) } - /// - /// Signs the assembled transaction. - /// - /// # Arguments - /// - /// * `key` - The signing key. - /// * `network_passphrase` - The network passphrase. - /// - /// # Errors - /// - /// Returns an error if signing the transaction fails. pub fn sign( self, key: &ed25519_dalek::SigningKey, network_passphrase: &str, ) -> Result { - let tx = self.transaction(); + let tx = self.txn(); let tx_hash = self.hash(network_passphrase)?; let tx_signature = key.sign(&tx_hash); @@ -88,17 +55,6 @@ impl Assembled { })) } - /// - /// Simulates the assembled transaction. - /// - /// # Arguments - /// - /// * `tx` - The original transaction. - /// * `client` - The client used for simulation. - /// - /// # Errors - /// - /// Returns an error if simulation fails. pub async fn simulate( tx: &Transaction, client: &Client, @@ -111,18 +67,6 @@ impl Assembled { .await } - /// - /// Handles the restore process for the assembled transaction. - /// - /// # Arguments - /// - /// * `client` - The client used for submission. - /// * `source_key` - The signing key of the source account. - /// * `network_passphrase` - The network passphrase. - /// - /// # Errors - /// - /// Returns an error if the restore process fails. pub async fn handle_restore( self, client: &Client, @@ -133,7 +77,7 @@ impl Assembled { // Build and submit the restore transaction client .send_transaction( - &Assembled::new(&restore(self.transaction(), restore_preamble)?, client) + &Assembled::new(&restore(self.txn(), restore_preamble)?, client) .await? .sign(source_key, network_passphrase)?, ) @@ -144,20 +88,14 @@ impl Assembled { } } - /// Returns a reference to the original transaction. - #[must_use] - pub fn transaction(&self) -> &Transaction { + pub fn txn(&self) -> &Transaction { &self.txn } - /// Returns a reference to the simulation response. - #[must_use] - pub fn sim_response(&self) -> &SimulateTransactionResponse { + pub fn sim_res(&self) -> &SimulateTransactionResponse { &self.sim_res } - /// - /// # Errors pub async fn authorize( self, client: &Client, @@ -167,7 +105,7 @@ impl Assembled { network_passphrase: &str, ) -> Result { if let Some(txn) = sign_soroban_authorizations( - self.transaction(), + self.txn(), source_key, signers, seq_num, @@ -179,16 +117,12 @@ impl Assembled { } } - #[must_use] pub fn bump_seq_num(mut self) -> Self { self.txn.seq_num.0 += 1; self } - /// - /// # Errors - #[must_use] - pub fn auth_entries(&self) -> VecM { + pub fn auth(&self) -> VecM { self.txn .operations .first() @@ -203,8 +137,6 @@ impl Assembled { .unwrap_or_default() } - /// - /// # Errors pub fn log( &self, log_events: Option, @@ -219,55 +151,15 @@ impl Assembled { log(resources); } if let Some(log) = log_events { - log(footprint, &[self.auth_entries()], &self.sim_res.events()?); + log(footprint, &[self.auth()], &self.sim_res.events()?); }; } Ok(()) } - - #[must_use] - pub fn requires_auth(&self) -> bool { - requires_auth(&self.txn).is_some() - } - - #[must_use] - pub fn is_view(&self) -> bool { - let TransactionExt::V1(SorobanTransactionData { - resources: - SorobanResources { - footprint: LedgerFootprint { read_write, .. }, - .. - }, - .. - }) = &self.txn.ext - else { - return false; - }; - read_write.is_empty() - } - - #[must_use] - pub fn set_max_instructions(mut self, instructions: u32) -> Self { - if let TransactionExt::V1(SorobanTransactionData { - resources: - SorobanResources { - instructions: ref mut i, - .. - }, - .. - }) = &mut self.txn.ext - { - tracing::trace!("setting max instructions to {instructions} from {i}"); - *i = instructions; - } - self - } } // Apply the result of a simulateTransaction onto a transaction envelope, preparing it for // submission to the network. -/// -/// # Errors pub fn assemble( raw: &Transaction, simulation: &SimulateTransactionResponse, @@ -314,7 +206,7 @@ pub fn assemble( } // update the fees of the actual transaction to meet the minimum resource fees. - let classic_transaction_fees = crate::DEFAULT_TRANSACTION_FEES; + let classic_transaction_fees = crate::fee::Args::default().fee; // Pad the fees up by 15% for a bit of wiggle room. tx.fee = (tx.fee.max( classic_transaction_fees @@ -328,21 +220,6 @@ pub fn assemble( Ok(tx) } -fn requires_auth(txn: &Transaction) -> Option { - let [op @ Operation { - body: OperationBody::InvokeHostFunction(InvokeHostFunctionOp { auth, .. }), - .. - }] = txn.operations.as_slice() - else { - return None; - }; - matches!( - auth.first().map(|x| &x.root_invocation.function), - Some(&SorobanAuthorizedFunction::ContractFn(_)) - ) - .then(move || op.clone()) -} - // Use the given source_key and signers, to sign all SorobanAuthorizationEntry's in the given // transaction. If unable to sign, return an error. fn sign_soroban_authorizations( @@ -353,8 +230,18 @@ fn sign_soroban_authorizations( network_passphrase: &str, ) -> Result, Error> { let mut tx = raw.clone(); - let Some(mut op) = requires_auth(&tx) else { - return Ok(None); + let mut op = match tx.operations.as_slice() { + [op @ Operation { + body: OperationBody::InvokeHostFunction(InvokeHostFunctionOp { auth, .. }), + .. + }] if matches!( + auth.first().map(|x| &x.root_invocation.function), + Some(&SorobanAuthorizedFunction::ContractFn(_)) + ) => + { + op.clone() + } + _ => return Ok(None), }; let Operation { @@ -491,8 +378,6 @@ fn sign_soroban_authorization_entry( Ok(auth) } -/// -/// # Errors pub fn restore(parent: &Transaction, restore: &RestorePreamble) -> Result { let transaction_data = SorobanTransactionData::from_xdr_base64(&restore.transaction_data, Limits::none())?; @@ -513,7 +398,8 @@ pub fn restore(parent: &Transaction, restore: &RestorePreamble) -> Result Result<[u8; 32], stellar_strkey::DecodeError> { - Ok( - if let Ok(strkey) = stellar_strkey::Contract::from_string(contract_id) { - strkey.0 - } else { + stellar_strkey::Contract::from_string(contract_id) + .map(|strkey| strkey.0) + .or_else(|_| { // strkey failed, try to parse it as a hex string, for backwards compatibility. soroban_spec_tools::utils::padded_hex_from_str(contract_id, 32) .map_err(|_| stellar_strkey::DecodeError::Invalid)? .try_into() - .map_err(|_| stellar_strkey::DecodeError::Invalid)? - }, - ) + .map_err(|_| stellar_strkey::DecodeError::Invalid) + }) + .map_err(|_| stellar_strkey::DecodeError::Invalid) } /// # Errors @@ -199,5 +198,47 @@ mod tests { ), Err(err) => panic!("Failed to parse contract id: {err}"), } + + // hex + match contract_id_from_str( + "363eaa3867841fbad0f4ed88c779e4fe66e56a2470dc98c0ec9c073d05c7b103", + ) { + Ok(contract_id) => assert_eq!( + contract_id, + [ + 0x36, 0x3e, 0xaa, 0x38, 0x67, 0x84, 0x1f, 0xba, 0xd0, 0xf4, 0xed, 0x88, 0xc7, + 0x79, 0xe4, 0xfe, 0x66, 0xe5, 0x6a, 0x24, 0x70, 0xdc, 0x98, 0xc0, 0xec, 0x9c, + 0x07, 0x3d, 0x05, 0xc7, 0xb1, 0x03, + ] + ), + Err(err) => panic!("Failed to parse contract id: {err}"), + } + + // unpadded-hex + match contract_id_from_str("1") { + Ok(contract_id) => assert_eq!( + contract_id, + [ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + ] + ), + Err(err) => panic!("Failed to parse contract id: {err}"), + } + + // invalid hex + match contract_id_from_str("foobar") { + Ok(_) => panic!("Expected parsing to fail"), + Err(err) => assert_eq!(err, stellar_strkey::DecodeError::Invalid), + } + + // hex too long (33 bytes) + match contract_id_from_str( + "000000000000000000000000000000000000000000000000000000000000000000", + ) { + Ok(_) => panic!("Expected parsing to fail"), + Err(err) => assert_eq!(err, stellar_strkey::DecodeError::Invalid), + } } } diff --git a/cmd/crates/soroban-spec-tools/src/contract.rs b/cmd/soroban-cli/src/utils/contract_spec.rs similarity index 98% rename from cmd/crates/soroban-spec-tools/src/contract.rs rename to cmd/soroban-cli/src/utils/contract_spec.rs index 2d0d857cd..b4f24abec 100644 --- a/cmd/crates/soroban-spec-tools/src/contract.rs +++ b/cmd/soroban-cli/src/utils/contract_spec.rs @@ -10,7 +10,7 @@ use soroban_env_host::xdr::{ StringM, WriteXdr, }; -pub struct Spec { +pub struct ContractSpec { pub env_meta_base64: Option, pub env_meta: Vec, pub meta_base64: Option, @@ -38,7 +38,7 @@ pub enum Error { Parser(#[from] wasmparser::BinaryReaderError), } -impl Spec { +impl ContractSpec { pub fn new(bytes: &[u8]) -> Result { let mut env_meta: Option<&[u8]> = None; let mut meta: Option<&[u8]> = None; @@ -87,7 +87,7 @@ impl Spec { vec![] }; - Ok(Spec { + Ok(ContractSpec { env_meta_base64, env_meta, meta_base64, @@ -108,7 +108,7 @@ impl Spec { } } -impl Display for Spec { +impl Display for ContractSpec { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { if let Some(env_meta) = &self.env_meta_base64 { writeln!(f, "Env Meta: {env_meta}")?; diff --git a/cmd/soroban-cli/src/wasm.rs b/cmd/soroban-cli/src/wasm.rs index 4b8a7f8ca..fce44c7c5 100644 --- a/cmd/soroban-cli/src/wasm.rs +++ b/cmd/soroban-cli/src/wasm.rs @@ -1,12 +1,11 @@ use clap::arg; use soroban_env_host::xdr::{self, LedgerKey, LedgerKeyContractCode}; -use soroban_spec_tools::contract::{self, Spec}; use std::{ fs, io, path::{Path, PathBuf}, }; -use crate::utils::{self}; +use crate::utils::{self, contract_spec::ContractSpec}; #[derive(thiserror::Error, Debug)] pub enum Error { @@ -26,7 +25,7 @@ pub enum Error { #[error(transparent)] Parser(#[from] wasmparser::BinaryReaderError), #[error(transparent)] - ContractSpec(#[from] contract::Error), + ContractSpec(#[from] crate::utils::contract_spec::Error), } #[derive(Debug, clap::Args, Clone)] @@ -61,9 +60,9 @@ impl Args { /// # Errors /// May fail to read wasm file or parse xdr section - pub fn parse(&self) -> Result { + pub fn parse(&self) -> Result { let contents = self.read()?; - Ok(Spec::new(&contents)?) + Ok(ContractSpec::new(&contents)?) } } diff --git a/docs/soroban-cli-full-docs.md b/docs/soroban-cli-full-docs.md index e33794a22..34ab0caa2 100644 --- a/docs/soroban-cli-full-docs.md +++ b/docs/soroban-cli-full-docs.md @@ -110,28 +110,13 @@ Full CLI reference: https://github.com/stellar/soroban-tools/tree/main/docs/soro ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `-f`, `--filter-logs ` — Filter logs output. To turn on "soroban_cli::log::footprint=debug" or off "=off". Can also use env var `RUST_LOG` * `-q`, `--quiet` — Do not write logs to stderr including `INFO` - - Possible values: `true`, `false` - * `-v`, `--verbose` — Log DEBUG events - - Possible values: `true`, `false` - * `--very-verbose` — Log DEBUG and TRACE events - - Possible values: `true`, `false` - * `--list` — List installed plugins. E.g. `soroban-hello` - Possible values: `true`, `false` - - ## `soroban completion` @@ -200,9 +185,6 @@ Add a new network * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -220,9 +202,6 @@ Remove a network ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -236,15 +215,9 @@ List networks ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `-l`, `--long` — Get more info about the networks - Possible values: `true`, `false` - - ## `soroban config identity` @@ -278,17 +251,8 @@ Add a new identity (keypair, ledger, macOS keychain) ###### **Options:** * `--secret-key` — Add using secret_key Can provide with SOROBAN_SECRET_KEY - - Possible values: `true`, `false` - * `--seed-phrase` — Add using 12 word seed phrase to generate secret_key - - Possible values: `true`, `false` - * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -307,9 +271,6 @@ Given an identity return its address (public key) * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -331,9 +292,6 @@ Fund an identity on a test network * `--network ` — Name of network to use from config * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -351,24 +309,12 @@ Generate a new identity with a seed phrase, currently 12 words ###### **Options:** * `--no-fund` — Do not fund address - - Possible values: `true`, `false` - * `--seed ` — Optional seed to use when generating seed phrase. Random otherwise * `-s`, `--as-secret` — Output the generated identity as a secret key - - Possible values: `true`, `false` - * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--hd-path ` — When generating a secret key, which hd_path should be used from the original seed_phrase * `-d`, `--default-seed` — Generate the default seed phrase. Useful for testing. Equivalent to --seed 0000000000000000 - - Possible values: `true`, `false` - * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config @@ -384,15 +330,9 @@ List identities ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `-l`, `--long` - Possible values: `true`, `false` - - ## `soroban config identity rm` @@ -408,9 +348,6 @@ Remove an identity ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -429,9 +366,6 @@ Given an identity return its private key * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -489,9 +423,6 @@ Get Id of builtin Soroban Asset Contract. Deprecated, use `soroban contract id a * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -511,9 +442,6 @@ Deploy builtin Soroban Asset Contract * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm @@ -570,14 +498,8 @@ Generate a TypeScript / JavaScript package * `--wasm ` — Path to optional wasm binary * `--output-dir ` — Where to place generated project * `--overwrite` — Whether to overwrite output directory if it already exists - - Possible values: `true`, `false` - * `--contract-id ` — The contract ID/address on the network * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server @@ -606,19 +528,10 @@ To view the commands that will be executed, without executing them, use the --pr Default value: `release` * `--features ` — Build with the list of features activated, space or comma separated * `--all-features` — Build with the all features activated - - Possible values: `true`, `false` - * `--no-default-features` — Build with the default feature not activated - - Possible values: `true`, `false` - * `--out-dir ` — Directory to copy wasm files to * `--print-commands-only` — Print commands to build without executing them - Possible values: `true`, `false` - - ## `soroban contract extend` @@ -633,9 +546,6 @@ If no keys are specified the contract itself is extended. * `--ledgers-to-extend ` — Number of ledgers to extend the entries * `--ttl-ledger-only` — Only print the new Time To Live ledger - - Possible values: `true`, `false` - * `--id ` — Contract ID to which owns the data entries. If no keys provided the Contract's instance will be extended * `--key ` — Storage key (symbols only) * `--key-xdr ` — Storage key (base64-encoded XDR) @@ -643,8 +553,6 @@ If no keys are specified the contract itself is extended. * `--wasm-hash ` — Path to Wasm file of contract code to extend * `--durability ` — Storage entry durability - Default value: `persistent` - Possible values: - `persistent`: Persistent @@ -657,9 +565,6 @@ If no keys are specified the contract itself is extended. * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm @@ -684,9 +589,6 @@ Deploy a wasm contract * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm @@ -695,9 +597,6 @@ Deploy a wasm contract Default value: `false` - Possible values: `true`, `false` - - ## `soroban contract fetch` @@ -711,9 +610,6 @@ Fetch a contract's Wasm binary * `--id ` — Contract ID to fetch * `-o`, `--out-file ` — Where to write output otherwise stdout is used * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server @@ -749,9 +645,6 @@ Deploy builtin Soroban Asset Contract * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -771,9 +664,6 @@ Deploy normal Wasm Contract * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -819,9 +709,6 @@ Inspect a WASM file listing contract functions, meta, etc Pretty print of contract spec entries * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -840,9 +727,6 @@ Install a WASM file to the ledger without creating a contract instance * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm @@ -852,9 +736,6 @@ Install a WASM file to the ledger without creating a contract instance Default value: `false` - Possible values: `true`, `false` - - ## `soroban contract invoke` @@ -875,23 +756,12 @@ soroban contract invoke ... -- --help * `--id ` — Contract ID to invoke * `--cost` — Output the cost execution to stderr - - Possible values: `true`, `false` - -* `--instructions ` — Number of instructions to simulate -* `--is-view` — Do not sign and submit transaction - - Possible values: `true`, `false` - * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm @@ -939,8 +809,6 @@ Print the current value of a contract-data ledger entry * `--wasm-hash ` — Path to Wasm file of contract code to extend * `--durability ` — Storage entry durability - Default value: `persistent` - Possible values: - `persistent`: Persistent @@ -953,9 +821,6 @@ Print the current value of a contract-data ledger entry * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -977,8 +842,6 @@ If no keys are specificed the contract itself is restored. * `--wasm-hash ` — Path to Wasm file of contract code to extend * `--durability ` — Storage entry durability - Default value: `persistent` - Possible values: - `persistent`: Persistent @@ -987,18 +850,12 @@ If no keys are specificed the contract itself is restored. * `--ledgers-to-extend ` — Number of ledgers to extend the entry * `--ttl-ledger-only` — Only print the new Time To Live ledger - - Possible values: `true`, `false` - * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm @@ -1040,9 +897,6 @@ Watch the network for contract events Possible values: `all`, `contract`, `system` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server @@ -1081,17 +935,8 @@ Add a new identity (keypair, ledger, macOS keychain) ###### **Options:** * `--secret-key` — Add using secret_key Can provide with SOROBAN_SECRET_KEY - - Possible values: `true`, `false` - * `--seed-phrase` — Add using 12 word seed phrase to generate secret_key - - Possible values: `true`, `false` - * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -1110,9 +955,6 @@ Given an identity return its address (public key) * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -1134,9 +976,6 @@ Fund an identity on a test network * `--network ` — Name of network to use from config * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -1154,24 +993,12 @@ Generate a new identity with a seed phrase, currently 12 words ###### **Options:** * `--no-fund` — Do not fund address - - Possible values: `true`, `false` - * `--seed ` — Optional seed to use when generating seed phrase. Random otherwise * `-s`, `--as-secret` — Output the generated identity as a secret key - - Possible values: `true`, `false` - * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--hd-path ` — When generating a secret key, which hd_path should be used from the original seed_phrase * `-d`, `--default-seed` — Generate the default seed phrase. Useful for testing. Equivalent to --seed 0000000000000000 - - Possible values: `true`, `false` - * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config @@ -1187,15 +1014,9 @@ List identities ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `-l`, `--long` - Possible values: `true`, `false` - - ## `soroban keys rm` @@ -1211,9 +1032,6 @@ Remove an identity ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -1232,9 +1050,6 @@ Given an identity return its private key * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -1280,9 +1095,6 @@ Deploy a token contract to wrap an existing Stellar classic asset for smart cont * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm @@ -1305,9 +1117,6 @@ Compute the expected contract id for the given asset Deprecated, use `soroban co * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--hd-path ` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0` * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -1487,9 +1296,6 @@ Add a new network * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -1507,9 +1313,6 @@ Remove a network ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." @@ -1523,15 +1326,9 @@ List networks ###### **Options:** * `--global` — Use global config - - Possible values: `true`, `false` - * `--config-dir ` — Location of config directory, default is "." * `-l`, `--long` — Get more info about the networks - Possible values: `true`, `false` - - ## `soroban version`