Skip to content

Commit e465589

Browse files
authored
Add missing flags to show-config (#1309)
<!-- Reference any GitHub issues resolved by this PR --> ## Introduced changes <!-- A brief description of the changes --> - add missing properties to show-config command ## Checklist <!-- Make sure all of these are complete --> - [X] Linked relevant issue - [X] Updated relevant documentation - [X] Added relevant tests - [X] Performed self-review of the code - [X] Added changes to `CHANGELOG.md`
1 parent 7823d25 commit e465589

File tree

5 files changed

+47
-3
lines changed

5 files changed

+47
-3
lines changed

crates/cast/src/helpers/response_structs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ pub struct ShowConfigResponse {
5858
pub scarb_path: Option<Utf8PathBuf>,
5959
pub accounts_file_path: Option<Utf8PathBuf>,
6060
pub keystore: Option<Utf8PathBuf>,
61+
pub wait_timeout: Option<u16>,
62+
pub wait_retry_interval: Option<u8>,
6163
}
6264

6365
#[derive(Serialize)]

crates/cast/src/starknet_commands/show_config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ pub async fn show_config(
2929
if keystore.is_some() {
3030
accounts_file_path = None;
3131
}
32+
let wait_timeout = Some(cast_config.wait_timeout);
33+
let wait_retry_interval = Some(cast_config.wait_retry_interval);
3234

3335
Ok(ShowConfigResponse {
3436
profile,
@@ -38,5 +40,7 @@ pub async fn show_config(
3840
scarb_path,
3941
accounts_file_path,
4042
keystore,
43+
wait_timeout,
44+
wait_retry_interval,
4145
})
4246
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "correct"
3+
version = "0.1.0"
4+
5+
[dependencies]
6+
starknet = ">=1.1.1"
7+
8+
[[target.starknet-contract]]
9+
casm = true
10+
11+
[lib]
12+
sierra = false
13+
14+
[tool.sncast]
15+
url = "http://127.0.0.1:5055/rpc"
16+
account = "/path/to/account.json"
17+
keystore = "../keystore"
18+
19+
[tool.sncast.profile1]
20+
url = "http://127.0.0.1:5055/rpc"
21+
account = "user1"
22+
accounts-file = "../account-file"
23+
wait-timeout = 123
24+
wait-retry-interval = 12

crates/cast/tests/e2e/show_config.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use indoc::indoc;
55
async fn test_show_config_from_scarb_toml() {
66
let args = vec![
77
"--path-to-scarb-toml",
8-
"tests/data/show_config/all_Scarb.toml",
8+
"tests/data/show_config/wait_Scarb.toml",
99
"--profile",
1010
"profile1",
1111
"show-config",
@@ -20,7 +20,9 @@ async fn test_show_config_from_scarb_toml() {
2020
chain_id: alpha-goerli
2121
profile: profile1
2222
rpc_url: http://127.0.0.1:5055/rpc
23-
scarb_path: tests/data/show_config/all_Scarb.toml
23+
scarb_path: tests/data/show_config/wait_Scarb.toml
24+
wait_retry_interval: 12
25+
wait_timeout: 123
2426
"});
2527
}
2628

@@ -33,6 +35,10 @@ async fn test_show_config_from_cli() {
3335
"http://127.0.0.1:5055/rpc",
3436
"--keystore",
3537
"../keystore",
38+
"--wait-timeout",
39+
"2",
40+
"--wait-retry-interval",
41+
"1",
3642
"show-config",
3743
];
3844

@@ -44,6 +50,8 @@ async fn test_show_config_from_cli() {
4450
chain_id: alpha-goerli
4551
keystore: ../keystore
4652
rpc_url: http://127.0.0.1:5055/rpc
53+
wait_retry_interval: 1
54+
wait_timeout: 2
4755
"});
4856
}
4957

@@ -69,6 +77,8 @@ async fn test_show_config_from_cli_and_scarb() {
6977
profile: profile1
7078
rpc_url: http://127.0.0.1:5055/rpc
7179
scarb_path: tests/data/show_config/all_Scarb.toml
80+
wait_retry_interval: 5
81+
wait_timeout: 300
7282
"});
7383
}
7484

@@ -92,6 +102,8 @@ async fn test_show_config_when_no_keystore() {
92102
profile: profile1
93103
rpc_url: http://127.0.0.1:5055/rpc
94104
scarb_path: tests/data/show_config/all_Scarb.toml
105+
wait_retry_interval: 5
106+
wait_timeout: 300
95107
"});
96108
}
97109

@@ -112,5 +124,7 @@ async fn test_show_config_when_keystore() {
112124
keystore: ../keystore
113125
rpc_url: http://127.0.0.1:5055/rpc
114126
scarb_path: tests/data/show_config/all_Scarb.toml
127+
wait_retry_interval: 5
128+
wait_timeout: 300
115129
"});
116130
}

docs/src/appendix/cast-library/invoke.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
nonce: Option<felt252>
99
) -> InvokeResult`
1010

11-
Deploys a contract and returns `InvokeResult`.
11+
Invokes a contract and returns `InvokeResult`.
1212

1313
```rust
1414
#[derive(Drop, Clone)]

0 commit comments

Comments
 (0)