diff --git a/FULL_HELP_DOCS.md b/FULL_HELP_DOCS.md index 479ac67203..1755e65f5e 100644 --- a/FULL_HELP_DOCS.md +++ b/FULL_HELP_DOCS.md @@ -148,7 +148,7 @@ Deploy builtin Soroban Asset Contract * `--cost` — Output the cost execution to stderr * `--instructions ` — Number of instructions to simulate * `--build-only` — Build the transaction and only write the base64 xdr to stdout -* `--sim-only` — Simulate the transaction and only write the base64 xdr to stdout +* `--sim-only` — (Deprecated) simulate the transaction and only write the base64 xdr to stdout @@ -373,7 +373,7 @@ If no keys are specified the contract itself is extended. * `--cost` — Output the cost execution to stderr * `--instructions ` — Number of instructions to simulate * `--build-only` — Build the transaction and only write the base64 xdr to stdout -* `--sim-only` — Simulate the transaction and only write the base64 xdr to stdout +* `--sim-only` — (Deprecated) simulate the transaction and only write the base64 xdr to stdout @@ -401,7 +401,7 @@ Deploy a wasm contract * `--cost` — Output the cost execution to stderr * `--instructions ` — Number of instructions to simulate * `--build-only` — Build the transaction and only write the base64 xdr to stdout -* `--sim-only` — Simulate the transaction and only write the base64 xdr to stdout +* `--sim-only` — (Deprecated) simulate the transaction and only write the base64 xdr to stdout * `-i`, `--ignore-checks` — Whether to ignore safety checks when deploying contracts Default value: `false` @@ -679,7 +679,7 @@ Install a WASM file to the ledger without creating a contract instance * `--cost` — Output the cost execution to stderr * `--instructions ` — Number of instructions to simulate * `--build-only` — Build the transaction and only write the base64 xdr to stdout -* `--sim-only` — Simulate the transaction and only write the base64 xdr to stdout +* `--sim-only` — (Deprecated) simulate the transaction and only write the base64 xdr to stdout * `--wasm ` — Path to wasm binary * `-i`, `--ignore-checks` — Whether to ignore safety checks when deploying contracts @@ -718,7 +718,7 @@ stellar contract invoke ... -- --help * `--cost` — Output the cost execution to stderr * `--instructions ` — Number of instructions to simulate * `--build-only` — Build the transaction and only write the base64 xdr to stdout -* `--sim-only` — Simulate the transaction and only write the base64 xdr to stdout +* `--sim-only` — (Deprecated) simulate the transaction and only write the base64 xdr to stdout * `--send ` — Whether or not to send a transaction Default value: `default` @@ -832,7 +832,7 @@ If no keys are specificed the contract itself is restored. * `--cost` — Output the cost execution to stderr * `--instructions ` — Number of instructions to simulate * `--build-only` — Build the transaction and only write the base64 xdr to stdout -* `--sim-only` — Simulate the transaction and only write the base64 xdr to stdout +* `--sim-only` — (Deprecated) simulate the transaction and only write the base64 xdr to stdout diff --git a/cmd/soroban-cli/src/fee.rs b/cmd/soroban-cli/src/fee.rs index 698d66007b..44de4be3d1 100644 --- a/cmd/soroban-cli/src/fee.rs +++ b/cmd/soroban-cli/src/fee.rs @@ -1,9 +1,14 @@ use clap::arg; +use clap::builder::TypedValueParser; use soroban_env_host::xdr; use soroban_rpc::Assembled; -use crate::commands::HEADING_RPC; +use crate::{commands::HEADING_RPC, deprecated_arg}; + +const DEPRECATION_MESSAGE: &str = "--sim-only is deprecated and will be removed \ +in the future versions of CLI. The same functionality is offered by `tx simulate` command. To \ +replicate the behaviour, you can run `stellar --build only | stellar tx simulate`"; #[derive(Debug, clap::Args, Clone)] #[group(skip)] @@ -20,8 +25,13 @@ pub struct Args { /// Build the transaction and only write the base64 xdr to stdout #[arg(long, help_heading = HEADING_RPC)] pub build_only: bool, - /// Simulate the transaction and only write the base64 xdr to stdout - #[arg(long, help_heading = HEADING_RPC, conflicts_with = "build_only")] + /// (Deprecated) simulate the transaction and only write the base64 xdr to stdout + #[arg( + long, + help_heading = HEADING_RPC, + conflicts_with = "build_only", + value_parser = deprecated_arg!(bool, DEPRECATION_MESSAGE)) + ] pub sim_only: bool, } diff --git a/cmd/soroban-cli/src/utils.rs b/cmd/soroban-cli/src/utils.rs index f5827f75b8..687cfccce8 100644 --- a/cmd/soroban-cli/src/utils.rs +++ b/cmd/soroban-cli/src/utils.rs @@ -148,6 +148,24 @@ pub fn get_name_from_stellar_asset_contract_storage(storage: &ScMap) -> Option { + clap::builder::BoolValueParser::new().map(|x| { + crate::print::Print::new(false).warnln($message); + x + }) + }; + } +} + pub mod rpc { use soroban_env_host::xdr; use soroban_rpc::{Client, Error};