From a8fcc6064c95a0691242610cbd80ca6cec75f5d8 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 1 May 2024 21:51:38 +1000 Subject: [PATCH 1/3] Remove deprecated lab token command that has been moved --- cmd/soroban-cli/src/commands/lab/mod.rs | 8 ---- cmd/soroban-cli/src/commands/lab/token/mod.rs | 38 ------------------- 2 files changed, 46 deletions(-) delete mode 100644 cmd/soroban-cli/src/commands/lab/token/mod.rs diff --git a/cmd/soroban-cli/src/commands/lab/mod.rs b/cmd/soroban-cli/src/commands/lab/mod.rs index f405efe6d..ee5085e9e 100644 --- a/cmd/soroban-cli/src/commands/lab/mod.rs +++ b/cmd/soroban-cli/src/commands/lab/mod.rs @@ -1,21 +1,14 @@ use clap::Subcommand; use stellar_xdr::cli as xdr; -pub mod token; - #[derive(Debug, Subcommand)] pub enum Cmd { - /// Wrap, create, and manage token contracts - Token(token::Root), - /// Decode xdr Xdr(xdr::Root), } #[derive(thiserror::Error, Debug)] pub enum Error { - #[error(transparent)] - Token(#[from] token::Error), #[error(transparent)] Xdr(#[from] xdr::Error), } @@ -23,7 +16,6 @@ pub enum Error { impl Cmd { pub async fn run(&self) -> Result<(), Error> { match &self { - Cmd::Token(token) => token.run().await?, Cmd::Xdr(xdr) => xdr.run()?, } Ok(()) diff --git a/cmd/soroban-cli/src/commands/lab/token/mod.rs b/cmd/soroban-cli/src/commands/lab/token/mod.rs deleted file mode 100644 index bd7eacf36..000000000 --- a/cmd/soroban-cli/src/commands/lab/token/mod.rs +++ /dev/null @@ -1,38 +0,0 @@ -use std::fmt::Debug; - -use crate::commands::contract::{deploy, id}; -use clap::{Parser, Subcommand}; - -#[derive(Parser, Debug)] -pub struct Root { - #[clap(subcommand)] - cmd: Cmd, -} - -#[derive(Subcommand, Debug)] -enum Cmd { - /// Deploy a token contract to wrap an existing Stellar classic asset for smart contract usage - /// Deprecated, use `soroban contract deploy asset` instead - Wrap(deploy::asset::Cmd), - /// Compute the expected contract id for the given asset - /// Deprecated, use `soroban contract id asset` instead - Id(id::asset::Cmd), -} - -#[derive(thiserror::Error, Debug)] -pub enum Error { - #[error(transparent)] - Wrap(#[from] deploy::asset::Error), - #[error(transparent)] - Id(#[from] id::asset::Error), -} - -impl Root { - pub async fn run(&self) -> Result<(), Error> { - match &self.cmd { - Cmd::Wrap(wrap) => wrap.run().await?, - Cmd::Id(id) => id.run()?, - } - Ok(()) - } -} From 5e460dcccdbd4a4d0b5de642dd6aec1c9d172940 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 1 May 2024 22:01:15 +1000 Subject: [PATCH 2/3] update docs --- docs/soroban-cli-full-docs.md | 69 ----------------------------------- 1 file changed, 69 deletions(-) diff --git a/docs/soroban-cli-full-docs.md b/docs/soroban-cli-full-docs.md index 68b9adc98..4bdcfc5a3 100644 --- a/docs/soroban-cli-full-docs.md +++ b/docs/soroban-cli-full-docs.md @@ -53,9 +53,6 @@ This document contains the help content for the `soroban` command-line program. * [`soroban keys rm`↴](#soroban-keys-rm) * [`soroban keys show`↴](#soroban-keys-show) * [`soroban lab`↴](#soroban-lab) -* [`soroban lab token`↴](#soroban-lab-token) -* [`soroban lab token wrap`↴](#soroban-lab-token-wrap) -* [`soroban lab token id`↴](#soroban-lab-token-id) * [`soroban lab xdr`↴](#soroban-lab-xdr) * [`soroban lab xdr types`↴](#soroban-lab-xdr-types) * [`soroban lab xdr types list`↴](#soroban-lab-xdr-types-list) @@ -1331,76 +1328,10 @@ Experiment with early features and expert tools ###### **Subcommands:** -* `token` — Wrap, create, and manage token contracts * `xdr` — Decode xdr -## `soroban lab token` - -Wrap, create, and manage token contracts - -**Usage:** `soroban lab token ` - -###### **Subcommands:** - -* `wrap` — Deploy a token contract to wrap an existing Stellar classic asset for smart contract usage Deprecated, use `soroban contract deploy asset` instead -* `id` — Compute the expected contract id for the given asset Deprecated, use `soroban contract id asset` instead - - - -## `soroban lab token wrap` - -Deploy a token contract to wrap an existing Stellar classic asset for smart contract usage Deprecated, use `soroban contract deploy asset` instead - -**Usage:** `soroban lab token wrap [OPTIONS] --asset --source-account ` - -###### **Options:** - -* `--asset ` — ID of the Stellar classic asset to wrap, e.g. "USDC:G...5" -* `--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 - - Default value: `100` -* `--cost` — Output the cost execution to stderr - - Possible values: `true`, `false` - -* `--instructions ` — Number of instructions to simulate - - - -## `soroban lab token id` - -Compute the expected contract id for the given asset Deprecated, use `soroban contract id asset` instead - -**Usage:** `soroban lab token id [OPTIONS] --asset --source-account ` - -###### **Options:** - -* `--asset ` — ID of the Stellar classic asset to wrap, e.g. "USDC:G...5" -* `--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 "." - - - ## `soroban lab xdr` Decode xdr From b809d7fbbe8be5b92b287b92f4475d291d135c8b Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 1 May 2024 23:06:35 +1000 Subject: [PATCH 3/3] fix --- cmd/soroban-cli/src/commands/lab/mod.rs | 2 +- cmd/soroban-cli/src/commands/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/soroban-cli/src/commands/lab/mod.rs b/cmd/soroban-cli/src/commands/lab/mod.rs index ee5085e9e..d183217fc 100644 --- a/cmd/soroban-cli/src/commands/lab/mod.rs +++ b/cmd/soroban-cli/src/commands/lab/mod.rs @@ -14,7 +14,7 @@ pub enum Error { } impl Cmd { - pub async fn run(&self) -> Result<(), Error> { + pub fn run(&self) -> Result<(), Error> { match &self { Cmd::Xdr(xdr) => xdr.run()?, } diff --git a/cmd/soroban-cli/src/commands/mod.rs b/cmd/soroban-cli/src/commands/mod.rs index fc052fee0..ab673a411 100644 --- a/cmd/soroban-cli/src/commands/mod.rs +++ b/cmd/soroban-cli/src/commands/mod.rs @@ -95,7 +95,7 @@ impl Root { Cmd::Completion(completion) => completion.run(), Cmd::Contract(contract) => contract.run(&self.global_args).await?, Cmd::Events(events) => events.run().await?, - Cmd::Lab(lab) => lab.run().await?, + Cmd::Lab(lab) => lab.run()?, Cmd::Network(network) => network.run().await?, Cmd::Version(version) => version.run(), Cmd::Keys(id) => id.run().await?,