Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
update for ui change to subcommand()
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim-crypto committed Jun 8, 2023
1 parent 3273d86 commit 6f851be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions token/cli/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ pub(crate) async fn bench_process_command(
) -> CommandResult {
assert!(!config.sign_only);

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

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

command_close_accounts(config, signers, &token, n, &owner).await?;
}
("deposit-into", Some(arg_matches)) => {
("deposit-into", arg_matches) => {
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
.unwrap()
.unwrap();
Expand All @@ -212,7 +213,7 @@ pub(crate) async fn bench_process_command(
)
.await?;
}
("withdraw-from", Some(arg_matches)) => {
("withdraw-from", arg_matches) => {
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
.unwrap()
.unwrap();
Expand Down
12 changes: 6 additions & 6 deletions token/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3653,9 +3653,9 @@ async fn main() -> Result<(), Error> {
let mut wallet_manager = None;
let mut bulk_signers: Vec<Arc<dyn Signer>> = Vec::new();

let (sub_command, sub_matches) = app_matches.subcommand();
let (sub_command, sub_matches) = app_matches.subcommand().unwrap();
let sub_command = CommandName::from_str(sub_command).unwrap();
let matches = sub_matches.unwrap();
let matches = sub_matches;

let mut multisigner_ids = Vec::new();
let config = Config::new(
Expand Down Expand Up @@ -4689,9 +4689,9 @@ mod tests {
&multisig_member_help,
)
.get_matches_from(args);
let (sub_command, sub_matches) = app_matches.subcommand();
let (sub_command, sub_matches) = app_matches.subcommand().unwrap();
let sub_command = CommandName::from_str(sub_command).unwrap();
let matches = sub_matches.unwrap();
let matches = sub_matches;

let wallet_manager = None;
let bulk_signers: Vec<Arc<dyn Signer>> = vec![Arc::new(clone_keypair(payer))];
Expand All @@ -4709,9 +4709,9 @@ mod tests {
&multisig_member_help,
)
.get_matches_from(args);
let (sub_command, sub_matches) = app_matches.subcommand();
let (sub_command, sub_matches) = app_matches.subcommand().unwrap();
let sub_command = CommandName::from_str(sub_command).unwrap();
let matches = sub_matches.unwrap();
let matches = sub_matches;

let mut wallet_manager = None;
let mut bulk_signers: Vec<Arc<dyn Signer>> = Vec::new();
Expand Down

0 comments on commit 6f851be

Please sign in to comment.