Skip to content

Commit 20402d9

Browse files
authored
Merge branch 'main' into fix/extra_print
2 parents 9aa2422 + 34e8a5d commit 20402d9

File tree

25 files changed

+688
-298
lines changed

25 files changed

+688
-298
lines changed

Cargo.lock

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ default-members = ["cmd/soroban-cli", "cmd/crates/soroban-spec-tools", "cmd/crat
1111
exclude = ["cmd/crates/soroban-test/tests/fixtures/hello"]
1212

1313
[workspace.package]
14-
version = "21.4.0"
14+
version = "21.4.1"
1515
rust-version = "1.79.0"
1616

1717
[workspace.dependencies.soroban-env-host]
@@ -27,15 +27,15 @@ version = "=21.5.0"
2727
version = "=21.5.0"
2828

2929
[workspace.dependencies.soroban-spec-json]
30-
version = "=21.4.0"
30+
version = "=21.4.1"
3131
path = "./cmd/crates/soroban-spec-json"
3232

3333
[workspace.dependencies.soroban-spec-typescript]
34-
version = "21.4.0"
34+
version = "21.4.1"
3535
path = "./cmd/crates/soroban-spec-typescript"
3636

3737
[workspace.dependencies.soroban-spec-tools]
38-
version = "21.4.0"
38+
version = "21.4.1"
3939
path = "./cmd/crates/soroban-spec-tools"
4040

4141
[workspace.dependencies.soroban-sdk]
@@ -48,7 +48,7 @@ version = "=21.2.0"
4848
version = "=21.2.0"
4949

5050
[workspace.dependencies.soroban-cli]
51-
version = "=21.4.0"
51+
version = "=21.4.1"
5252
path = "cmd/soroban-cli"
5353

5454
[workspace.dependencies.soroban-rpc]

FULL_HELP_DOCS.md

+77
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Tools for smart contract developers
7676
###### **Subcommands:**
7777

7878
* `asset` — Utilities to deploy a Stellar Asset Contract or get its id
79+
* `alias` — Utilities to manage contract aliases
7980
* `bindings` — Generate code client bindings for a contract
8081
* `build` — Build a contract from source
8182
* `extend` — Extend the time to live ledger of a contract-data ledger entry
@@ -151,6 +152,82 @@ Deploy builtin Soroban Asset Contract
151152

152153

153154

155+
## `stellar contract alias`
156+
157+
Utilities to manage contract aliases
158+
159+
**Usage:** `stellar contract alias <COMMAND>`
160+
161+
###### **Subcommands:**
162+
163+
* `remove` — Remove contract alias
164+
* `add` — Add contract alias
165+
* `show` — Show the contract id associated with a given alias
166+
167+
168+
169+
## `stellar contract alias remove`
170+
171+
Remove contract alias
172+
173+
**Usage:** `stellar contract alias remove [OPTIONS] <ALIAS>`
174+
175+
###### **Arguments:**
176+
177+
* `<ALIAS>` — The contract alias that will be removed
178+
179+
###### **Options:**
180+
181+
* `--global` — Use global config
182+
* `--config-dir <CONFIG_DIR>` — Location of config directory, default is "."
183+
* `--rpc-url <RPC_URL>` — RPC server endpoint
184+
* `--network-passphrase <NETWORK_PASSPHRASE>` — Network passphrase to sign the transaction sent to the rpc server
185+
* `--network <NETWORK>` — Name of network to use from config
186+
187+
188+
189+
## `stellar contract alias add`
190+
191+
Add contract alias
192+
193+
**Usage:** `stellar contract alias add [OPTIONS] --id <CONTRACT_ID> <ALIAS>`
194+
195+
###### **Arguments:**
196+
197+
* `<ALIAS>` — The contract alias that will be removed
198+
199+
###### **Options:**
200+
201+
* `--global` — Use global config
202+
* `--config-dir <CONFIG_DIR>` — Location of config directory, default is "."
203+
* `--rpc-url <RPC_URL>` — RPC server endpoint
204+
* `--network-passphrase <NETWORK_PASSPHRASE>` — Network passphrase to sign the transaction sent to the rpc server
205+
* `--network <NETWORK>` — Name of network to use from config
206+
* `--overwrite` — Overwrite the contract alias if it already exists
207+
* `--id <CONTRACT_ID>` — The contract id that will be associated with the alias
208+
209+
210+
211+
## `stellar contract alias show`
212+
213+
Show the contract id associated with a given alias
214+
215+
**Usage:** `stellar contract alias show [OPTIONS] <ALIAS>`
216+
217+
###### **Arguments:**
218+
219+
* `<ALIAS>` — The contract alias that will be displayed
220+
221+
###### **Options:**
222+
223+
* `--global` — Use global config
224+
* `--config-dir <CONFIG_DIR>` — Location of config directory, default is "."
225+
* `--rpc-url <RPC_URL>` — RPC server endpoint
226+
* `--network-passphrase <NETWORK_PASSPHRASE>` — Network passphrase to sign the transaction sent to the rpc server
227+
* `--network <NETWORK>` — Name of network to use from config
228+
229+
230+
154231
## `stellar contract bindings`
155232

156233
Generate code client bindings for a contract

cmd/crates/soroban-test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repository = "https://github.com/stellar/soroban-test"
66
authors = ["Stellar Development Foundation <[email protected]>"]
77
license = "Apache-2.0"
88
readme = "README.md"
9-
version = "21.4.0"
9+
version = "21.4.1"
1010
edition = "2021"
1111
rust-version.workspace = true
1212
autobins = false

cmd/crates/soroban-test/tests/fixtures/hello/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "soroban-hello"
3-
version = "21.4.0"
3+
version = "21.4.1"
44
edition = "2021"
55
publish = false
66

cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "test_custom_account"
3-
version = "21.4.0"
3+
version = "21.4.1"
44
authors = ["Stellar Development Foundation <[email protected]>"]
55
license = "Apache-2.0"
66
edition = "2021"

cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "test_custom_types"
3-
version = "21.4.0"
3+
version = "21.4.1"
44
authors = ["Stellar Development Foundation <[email protected]>"]
55
license = "Apache-2.0"
66
edition = "2021"

cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "test_hello_world"
3-
version = "21.4.0"
3+
version = "21.4.1"
44
authors = ["Stellar Development Foundation <[email protected]>"]
55
license = "Apache-2.0"
66
edition = "2021"

cmd/crates/soroban-test/tests/it/help.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use soroban_cli::commands::contract;
1+
use soroban_cli::commands::contract::{self, arg_parsing};
22
use soroban_test::TestEnv;
33

44
use crate::util::{invoke_custom as invoke, CUSTOM_TYPES, DEFAULT_CONTRACT_ID};
@@ -55,7 +55,7 @@ async fn complex_enum_help() {
5555
async fn multi_arg_failure() {
5656
assert!(matches!(
5757
invoke_custom("multi_args", "--b").await.unwrap_err(),
58-
contract::invoke::Error::MissingArgument(_)
58+
contract::invoke::Error::ArgParsing(arg_parsing::Error::MissingArgument(_))
5959
));
6060
}
6161

@@ -64,7 +64,9 @@ async fn handle_arg_larger_than_i32_failure() {
6464
let res = invoke_custom("i32_", &format!("--i32_={}", u32::MAX)).await;
6565
assert!(matches!(
6666
res,
67-
Err(contract::invoke::Error::CannotParseArg { .. })
67+
Err(contract::invoke::Error::ArgParsing(
68+
arg_parsing::Error::CannotParseArg { .. }
69+
))
6870
));
6971
}
7072

@@ -73,7 +75,9 @@ async fn handle_arg_larger_than_i64_failure() {
7375
let res = invoke_custom("i64_", &format!("--i64_={}", u64::MAX)).await;
7476
assert!(matches!(
7577
res,
76-
Err(contract::invoke::Error::CannotParseArg { .. })
78+
Err(contract::invoke::Error::ArgParsing(
79+
arg_parsing::Error::CannotParseArg { .. }
80+
))
7781
));
7882
}
7983

cmd/soroban-cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repository = "https://github.com/stellar/stellar-cli"
66
authors = ["Stellar Development Foundation <[email protected]>"]
77
license = "Apache-2.0"
88
readme = "README.md"
9-
version = "21.4.0"
9+
version = "21.4.1"
1010
edition = "2021"
1111
rust-version.workspace = true
1212
autobins = false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
use crate::commands::global;
2+
3+
pub mod add;
4+
pub mod remove;
5+
pub mod show;
6+
7+
#[derive(Debug, clap::Subcommand)]
8+
pub enum Cmd {
9+
/// Remove contract alias
10+
Remove(remove::Cmd),
11+
12+
/// Add contract alias
13+
Add(add::Cmd),
14+
15+
/// Show the contract id associated with a given alias
16+
Show(show::Cmd),
17+
}
18+
19+
#[derive(thiserror::Error, Debug)]
20+
pub enum Error {
21+
#[error(transparent)]
22+
Remove(#[from] remove::Error),
23+
24+
#[error(transparent)]
25+
Add(#[from] add::Error),
26+
27+
#[error(transparent)]
28+
Show(#[from] show::Error),
29+
}
30+
31+
impl Cmd {
32+
pub fn run(&self, global_args: &global::Args) -> Result<(), Error> {
33+
match &self {
34+
Cmd::Remove(remove) => remove.run(global_args)?,
35+
Cmd::Add(add) => add.run(global_args)?,
36+
Cmd::Show(show) => show.run(global_args)?,
37+
}
38+
Ok(())
39+
}
40+
}

0 commit comments

Comments
 (0)