diff --git a/cmd/soroban-cli/src/commands/contract/extend.rs b/cmd/soroban-cli/src/commands/contract/extend.rs index d98fb311f..7e9f1e98c 100644 --- a/cmd/soroban-cli/src/commands/contract/extend.rs +++ b/cmd/soroban-cli/src/commands/contract/extend.rs @@ -23,9 +23,9 @@ pub struct Cmd { /// Number of ledgers to extend the entries #[arg(long, required = true)] pub ledgers_to_extend: u32, - /// Only print the new TTL ledger + /// Only print the new Time To Live ledger #[arg(long)] - pub extension_ledger_only: bool, + pub ttl_ledger_only: bool, #[command(flatten)] pub key: key::Args, #[command(flatten)] @@ -80,11 +80,11 @@ pub enum Error { impl Cmd { #[allow(clippy::too_many_lines)] pub async fn run(&self) -> Result<(), Error> { - let expiration_ledger_seq = self.run_against_rpc_server().await?; - if self.extension_ledger_only { - println!("{expiration_ledger_seq}"); + let ttl_ledger = self.run_against_rpc_server().await?; + if self.ttl_ledger_only { + println!("{ttl_ledger}"); } else { - println!("New ttl ledger: {expiration_ledger_seq}"); + println!("New ttl ledger: {ttl_ledger}"); } Ok(()) diff --git a/cmd/soroban-cli/src/commands/contract/install.rs b/cmd/soroban-cli/src/commands/contract/install.rs index 87c2877a7..fc171bbbe 100644 --- a/cmd/soroban-cli/src/commands/contract/install.rs +++ b/cmd/soroban-cli/src/commands/contract/install.rs @@ -107,6 +107,7 @@ impl Cmd { config: self.config.clone(), fee: self.fee.clone(), ledgers_to_extend: None, + ttl_ledger_only: true, } .run_against_rpc_server() .await?; diff --git a/cmd/soroban-cli/src/commands/contract/mod.rs b/cmd/soroban-cli/src/commands/contract/mod.rs index b07011a28..c10c31502 100644 --- a/cmd/soroban-cli/src/commands/contract/mod.rs +++ b/cmd/soroban-cli/src/commands/contract/mod.rs @@ -20,7 +20,7 @@ pub enum Cmd { Build(build::Cmd), - /// Extend the expiry ledger of a contract-data ledger entry. + /// Extend the time to live ledger of a contract-data ledger entry. /// /// If no keys are specified the contract itself is extended. Extend(extend::Cmd), diff --git a/cmd/soroban-cli/src/commands/contract/restore.rs b/cmd/soroban-cli/src/commands/contract/restore.rs index f10cdb780..fb7f560fa 100644 --- a/cmd/soroban-cli/src/commands/contract/restore.rs +++ b/cmd/soroban-cli/src/commands/contract/restore.rs @@ -27,6 +27,9 @@ pub struct Cmd { /// Number of ledgers to extend the entry #[arg(long)] pub ledgers_to_extend: Option, + /// Only print the new Time To Live ledger + #[arg(long)] + pub ttl_ledger_only: bool, #[command(flatten)] pub config: config::Args, #[command(flatten)] @@ -92,7 +95,7 @@ impl Cmd { ledgers_to_extend, config: self.config.clone(), fee: self.fee.clone(), - extension_ledger_only: false, + ttl_ledger_only: false, } .run() .await?; diff --git a/cmd/soroban-rpc/internal/test/cli_test.go b/cmd/soroban-rpc/internal/test/cli_test.go index 4af05ccf4..f83380ace 100644 --- a/cmd/soroban-rpc/internal/test/cli_test.go +++ b/cmd/soroban-rpc/internal/test/cli_test.go @@ -329,7 +329,7 @@ func extend(t *testing.T, contractId string, amount string, rest string) uint64 res := runSuccessfulCLICmd( t, fmt.Sprintf( - "contract extend --extension-ledger-only --id=%s --durability persistent --ledgers-to-extend=%s %s", + "contract extend --ttl-ledger-only --id=%s --durability persistent --ledgers-to-extend=%s %s", contractId, amount, rest, diff --git a/docs/soroban-cli-full-docs.md b/docs/soroban-cli-full-docs.md index 30ffbe4b7..a07f46d5b 100644 --- a/docs/soroban-cli-full-docs.md +++ b/docs/soroban-cli-full-docs.md @@ -127,7 +127,7 @@ Tools for smart contract developers * `bindings` — Generate code client bindings for a contract * `build` — Build a contract from source -* `extend` — Extend the expiry ledger of a contract-data ledger entry +* `extend` — Extend the time to live ledger of a contract-data ledger entry * `deploy` — Deploy a contract * `fetch` — Fetch a contract's Wasm binary * `inspect` — Inspect a WASM file listing contract functions, meta, etc @@ -226,7 +226,7 @@ To view the commands that will be executed, without executing them, use the --pr ## `soroban contract extend` -Extend the expiry ledger of a contract-data ledger entry. +Extend the time to live ledger of a contract-data ledger entry. If no keys are specified the contract itself is extended. @@ -235,7 +235,7 @@ If no keys are specified the contract itself is extended. ###### **Options:** * `--ledgers-to-extend ` — Number of ledgers to extend the entries -* `--extension-ledger-only` — Only print the new TTL ledger +* `--ttl-ledger-only` — Only print the new Time To Live ledger * `--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) @@ -463,6 +463,7 @@ If no keys are specificed the contract itself is restored. Temporary * `--ledgers-to-extend ` — Number of ledgers to extend the entry +* `--ttl-ledger-only` — Only print the new Time To Live ledger * `--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