Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Set global to true in Cli args (#2529)" #2551

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Cast

#### Added

- It's possible to pass common arguments both before and after subcommand name, e.g. both `sncast --account default declare --contract_name name ...` and `sncast declare --account default --contract_name name ...` are allowed now.

#### Changed

- Short option for `--accounts-file` flag has been removed.
Expand Down
18 changes: 9 additions & 9 deletions crates/sncast/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,39 @@ struct Cli {
/// Account to be used for contract declaration;
/// When using keystore (`--keystore`), this should be a path to account file
/// When using accounts file, this should be an account name
#[clap(short = 'a', long, global = true)]
#[clap(short = 'a', long)]
account: Option<String>,

/// Path to the file holding accounts info
#[clap(long = "accounts-file", global = true)]
#[clap(long = "accounts-file")]
accounts_file_path: Option<Utf8PathBuf>,

/// Path to keystore file; if specified, --account should be a path to starkli JSON account file
#[clap(short, long, global = true)]
#[clap(short, long)]
keystore: Option<Utf8PathBuf>,

/// If passed, values will be displayed as integers
#[clap(long, conflicts_with = "hex_format", global = true)]
#[clap(long, conflicts_with = "hex_format")]
int_format: bool,

/// If passed, values will be displayed as hex
#[clap(long, conflicts_with = "int_format", global = true)]
#[clap(long, conflicts_with = "int_format")]
hex_format: bool,

/// If passed, output will be displayed in json format
#[clap(short, long, global = true)]
#[clap(short, long)]
json: bool,

/// If passed, command will wait until transaction is accepted or rejected
#[clap(short = 'w', long, global = true)]
#[clap(short = 'w', long)]
wait: bool,

/// Adjusts the time after which --wait assumes transaction was not received or rejected
#[clap(long, global = true)]
#[clap(long)]
wait_timeout: Option<u16>,

/// Adjusts the time between consecutive attempts to fetch transaction by --wait flag
#[clap(long, global = true)]
#[clap(long)]
wait_retry_interval: Option<u8>,

#[command(subcommand)]
Expand Down
32 changes: 0 additions & 32 deletions crates/sncast/tests/e2e/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,38 +52,6 @@ async fn test_happy_case(account: &str) {
assert!(matches!(receipt, Invoke(_)));
}

#[test_case("oz_cairo_0"; "cairo_0_account")]
#[test_case("oz_cairo_1"; "cairo_1_account")]
#[test_case("oz"; "oz_account")]
#[test_case("argent"; "argent_account")]
#[test_case("braavos"; "braavos_account")]
#[tokio::test]
async fn test_happy_case_common_arguments_after_subcommand(account: &str) {
let args = vec![
"invoke",
"--accounts-file",
ACCOUNT_FILE_PATH,
"--account",
account,
"--int-format",
"--json",
"--url",
URL,
"--contract-address",
MAP_CONTRACT_ADDRESS_SEPOLIA,
"--function",
"put",
"--calldata",
"0x1 0x2",
"--max-fee",
"99999999999999999",
"--fee-token",
"eth",
];

runner(&args).assert().success();
}

#[tokio::test]
async fn test_happy_case_human_readable() {
let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;
Expand Down
Loading