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

[token-cli] Upgrade to clap-v3 #6376

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a5a34dc
upgrade clap version to `3.2.23`
samkim-crypto Mar 9, 2024
48f95be
remove lifetime parameters from `ArgMatches`
samkim-crypto Mar 9, 2024
2aca375
remove extra lifetime parameters from `Arg`
samkim-crypto Mar 9, 2024
02eb067
remove extra lifetime parameters from `App`
samkim-crypto Mar 9, 2024
70e025a
use `usize` type parameters for `min_values` and `max_values`
samkim-crypto Mar 9, 2024
1119b85
use `char` type parameters for `short` arguments
samkim-crypto Mar 9, 2024
ec3e909
update syntax for custom validator functions
samkim-crypto Mar 9, 2024
ac5d43b
update pattern matching syntax for `subcommand`
samkim-crypto Mar 9, 2024
3ab988a
update for new `possible_values` syntax
samkim-crypto Mar 9, 2024
814a29c
allow deprecated input validation for now
samkim-crypto Mar 9, 2024
1dcc501
resolve lifetime specifier issue with higher order validator functions
samkim-crypto Mar 9, 2024
4ed6269
directly specify positional parameter indices
samkim-crypto Mar 9, 2024
bbf982c
remove non-functioning `owner` alias in some subcommands
samkim-crypto Mar 9, 2024
6ded606
remove long names for positional arguments
samkim-crypto Mar 9, 2024
73b4caf
remove potential panice from `value_of` and `is_present`
samkim-crypto Mar 11, 2024
18336ec
add custom `signer_from_path` and `signer_from_path_with_config`
samkim-crypto Mar 11, 2024
b48c155
cargo fmt
samkim-crypto Mar 11, 2024
b84bb8b
remove duplicate addition of args in invalid config test
samkim-crypto Mar 11, 2024
c376044
use `try_get_one` to parse `compute_unit_price` and `compute_unit_limit`
samkim-crypto Mar 29, 2024
07450df
hard-code `signer_arg` and `OfflineArgs`
samkim-crypto Apr 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions token/cli/Cargo.toml
Expand Up @@ -13,14 +13,14 @@ walkdir = "2"

[dependencies]
base64 = "0.22.0"
clap = "2.33.3"
clap = "3.2.23"
console = "0.15.8"
futures = "0.3"
serde = "1.0.198"
serde_derive = "1.0.103"
serde_json = "1.0.116"
solana-account-decoder = ">=1.18.11,<=2"
solana-clap-utils = ">=1.18.11,<=2"
solana-clap-v3-utils = ">=1.18.11,<=2"
solana-cli-config = ">=1.18.11,<=2"
solana-cli-output = ">=1.18.11,<=2"
solana-client = ">=1.18.11,<=2"
Expand All @@ -29,19 +29,19 @@ solana-remote-wallet = ">=1.18.11,<=2"
solana-sdk = ">=1.18.11,<=2"
solana-transaction-status = ">=1.18.11,<=2"
spl-token = { version = "4.0", path = "../program", features = [
"no-entrypoint",
"no-entrypoint",
] }
spl-token-2022 = { version = "3.0.2", path = "../program-2022", features = [
"no-entrypoint",
"no-entrypoint",
] }
spl-token-client = { version = "0.10.0", path = "../client" }
spl-token-metadata-interface = { version = "0.3.3", path = "../../token-metadata/interface" }
spl-token-group-interface = { version = "0.2.3", path = "../../token-group/interface" }
spl-associated-token-account = { version = "3.0.2", path = "../../associated-token-account/program", features = [
"no-entrypoint",
"no-entrypoint",
] }
spl-memo = { version = "4.0", path = "../../memo/program", features = [
"no-entrypoint",
"no-entrypoint",
] }
strum = "0.26"
strum_macros = "0.26"
Expand Down
12 changes: 6 additions & 6 deletions token/cli/src/bench.rs
Expand Up @@ -2,7 +2,7 @@
use {
crate::{clap_app::Error, command::CommandResult, config::Config},
clap::{value_t_or_exit, ArgMatches},
solana_clap_utils::input_parsers::pubkey_of_signer,
solana_clap_v3_utils::input_parsers::pubkey_of_signer,
solana_client::{
nonblocking::rpc_client::RpcClient, rpc_client::RpcClient as BlockingRpcClient,
tpu_client::TpuClient, tpu_client::TpuClientConfig,
Expand All @@ -22,15 +22,15 @@ use {
};

pub(crate) async fn bench_process_command(
matches: &ArgMatches<'_>,
matches: &ArgMatches,
config: &Config<'_>,
mut signers: Vec<Arc<dyn Signer>>,
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
) -> CommandResult {
assert!(!config.sign_only);

match matches.subcommand() {
("create-accounts", Some(arg_matches)) => {
Some(("create-accounts", arg_matches)) => {
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
.unwrap()
.unwrap();
Expand All @@ -42,7 +42,7 @@ pub(crate) async fn bench_process_command(

command_create_accounts(config, signers, &token, n, &owner).await?;
}
("close-accounts", Some(arg_matches)) => {
Some(("close-accounts", arg_matches)) => {
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
.unwrap()
.unwrap();
Expand All @@ -53,7 +53,7 @@ pub(crate) async fn bench_process_command(

command_close_accounts(config, signers, &token, n, &owner).await?;
}
("deposit-into", Some(arg_matches)) => {
Some(("deposit-into", arg_matches)) => {
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
.unwrap()
.unwrap();
Expand All @@ -68,7 +68,7 @@ pub(crate) async fn bench_process_command(
)
.await?;
}
("withdraw-from", Some(arg_matches)) => {
Some(("withdraw-from", arg_matches)) => {
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
.unwrap()
.unwrap();
Expand Down