cli code review (#6183)

This commit is contained in:
Rob Walker 2019-10-01 10:34:45 -07:00 committed by GitHub
parent ae7700296d
commit 214c041bf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 19 deletions

View File

@ -618,26 +618,28 @@ mod tests {
let pubkey = Pubkey::new_rand(); let pubkey = Pubkey::new_rand();
let pubkey_string = format!("{}", pubkey); let pubkey_string = format!("{}", pubkey);
// // Test AuthorizeStaker Subcommand let test_authorize_staker = test_commands.clone().get_matches_from(vec![
// let out_dir = std::env::var("FARF_DIR").unwrap_or_else(|_| "farf".to_string()); "test",
// let keypair = Keypair::new(); "stake-authorize-staker",
// let keypair_file = format!("{}/tmp/keypair_file-{}", out_dir, keypair.pubkey()); &pubkey_string,
// let _ = write_keypair(&keypair, &keypair_file).unwrap(); &pubkey_string,
// ]);
// let test_authorize_staker = test_commands.clone().get_matches_from(vec![ assert_eq!(
// "test", parse_command(&pubkey, &test_authorize_staker).unwrap(),
// "stake-authorize-staker", WalletCommand::StakeAuthorize(pubkey, pubkey, StakeAuthorize::Staker)
// &pubkey_string, );
// &keypair_file, let test_authorize_withdrawer = test_commands.clone().get_matches_from(vec![
// &pubkey_string, "test",
// ]); "stake-authorize-withdrawer",
// assert_eq!( &pubkey_string,
// parse_command(&pubkey, &test_authorize_staker).unwrap(), &pubkey_string,
// WalletCommand::StakeAuthorize(pubkey, keypair, pubkey, StakeAuthorize::Staker) ]);
// ); assert_eq!(
// fs::remove_file(&keypair_file).unwrap(); parse_command(&pubkey, &test_authorize_withdrawer).unwrap(),
WalletCommand::StakeAuthorize(pubkey, pubkey, StakeAuthorize::Withdrawer)
);
// Test CreateVoteAccount SubCommand // Test CreateStakeAccount SubCommand
let custodian = Pubkey::new_rand(); let custodian = Pubkey::new_rand();
let custodian_string = format!("{}", custodian); let custodian_string = format!("{}", custodian);
let authorized = Pubkey::new_rand(); let authorized = Pubkey::new_rand();