Skip to content

feat(contract): add --ledgers-to-extend and --ledgers-to-expire to upload, deploy, and restore - #2863

Closed
jdjioe5-cpu wants to merge 1 commit into
stellar:mainfrom
jdjioe5-cpu:feat/issue-809-ledgers-to-expire
Closed

jdjioe5-cpu wants to merge 1 commit into
stellar:mainfrom
jdjioe5-cpu:feat/issue-809-ledgers-to-expire

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown

Summary

Closes #809

This PR adds optional --ledgers-to-extend (with --ledgers-to-expire visible alias) to stellar contract upload (install), stellar contract deploy, and stellar contract asset deploy, and adds --ledgers-to-expire as a visible alias on stellar contract restore and stellar contract extend.

What Changed

  • cmd/soroban-cli/src/commands/contract/upload.rs:
    • Added --ledgers-to-extend (--ledgers-to-expire) to upload::Cmd (also used by contract install).
    • When provided, extends the uploaded contract code TTL via extend::Cmd.
  • cmd/soroban-cli/src/commands/contract/deploy/wasm.rs and cmd/soroban-cli/src/commands/contract/deploy/asset.rs:
    • Added --ledgers-to-extend (--ledgers-to-expire) to deploy::wasm::Cmd and deploy::asset::Cmd.
    • When provided, extends the deployed contract instance TTL (and uploaded WASM code TTL when uploading during deploy) via extend::Cmd.
  • cmd/soroban-cli/src/commands/contract/restore.rs and cmd/soroban-cli/src/commands/contract/extend.rs:
    • Added visible_alias = "ledgers-to-expire" to --ledgers-to-extend.
  • Added unit tests verifying CLI flag and alias parsing across upload, deploy, and restore.

Testing

  • Ran cargo test --package soroban-cli --lib commands::contract (all unit tests pass).
  • Ran cargo clippy --no-deps --package soroban-cli --lib -- -D warnings.

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Oct 23, 2026
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add optional --ledgers-to-expire flag to the install, deploy and restore commands

2 participants