nit: fix variable names (#16283)
This commit is contained in:
parent
da27acabcc
commit
aa45e81b3e
|
@ -2529,12 +2529,12 @@ mod tests {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Test Deploy Subcommand
|
// Test Deploy Subcommand
|
||||||
let test_deploy =
|
let test_command =
|
||||||
test_commands
|
test_commands
|
||||||
.clone()
|
.clone()
|
||||||
.get_matches_from(vec!["test", "deploy", "/Users/test/program.o"]);
|
.get_matches_from(vec!["test", "deploy", "/Users/test/program.o"]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Deploy {
|
command: CliCommand::Deploy {
|
||||||
program_location: "/Users/test/program.o".to_string(),
|
program_location: "/Users/test/program.o".to_string(),
|
||||||
|
@ -2549,14 +2549,14 @@ mod tests {
|
||||||
let custom_address = Keypair::new();
|
let custom_address = Keypair::new();
|
||||||
let custom_address_file = make_tmp_path("custom_address_file");
|
let custom_address_file = make_tmp_path("custom_address_file");
|
||||||
write_keypair_file(&custom_address, &custom_address_file).unwrap();
|
write_keypair_file(&custom_address, &custom_address_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"deploy",
|
"deploy",
|
||||||
"/Users/test/program.o",
|
"/Users/test/program.o",
|
||||||
&custom_address_file,
|
&custom_address_file,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Deploy {
|
command: CliCommand::Deploy {
|
||||||
program_location: "/Users/test/program.o".to_string(),
|
program_location: "/Users/test/program.o".to_string(),
|
||||||
|
|
|
@ -2194,14 +2194,14 @@ mod tests {
|
||||||
arg_name: "".to_string(),
|
arg_name: "".to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"deploy",
|
"deploy",
|
||||||
"/Users/test/program.so",
|
"/Users/test/program.so",
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
||||||
program_location: Some("/Users/test/program.so".to_string()),
|
program_location: Some("/Users/test/program.so".to_string()),
|
||||||
|
@ -2218,7 +2218,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"deploy",
|
"deploy",
|
||||||
|
@ -2227,7 +2227,7 @@ mod tests {
|
||||||
"42",
|
"42",
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
||||||
program_location: Some("/Users/test/program.so".to_string()),
|
program_location: Some("/Users/test/program.so".to_string()),
|
||||||
|
@ -2247,7 +2247,7 @@ mod tests {
|
||||||
let buffer_keypair = Keypair::new();
|
let buffer_keypair = Keypair::new();
|
||||||
let buffer_keypair_file = make_tmp_path("buffer_keypair_file");
|
let buffer_keypair_file = make_tmp_path("buffer_keypair_file");
|
||||||
write_keypair_file(&buffer_keypair, &buffer_keypair_file).unwrap();
|
write_keypair_file(&buffer_keypair, &buffer_keypair_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"deploy",
|
"deploy",
|
||||||
|
@ -2255,7 +2255,7 @@ mod tests {
|
||||||
&buffer_keypair_file,
|
&buffer_keypair_file,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
||||||
program_location: None,
|
program_location: None,
|
||||||
|
@ -2337,7 +2337,7 @@ mod tests {
|
||||||
let authority_keypair = Keypair::new();
|
let authority_keypair = Keypair::new();
|
||||||
let authority_keypair_file = make_tmp_path("authority_keypair_file");
|
let authority_keypair_file = make_tmp_path("authority_keypair_file");
|
||||||
write_keypair_file(&authority_keypair, &authority_keypair_file).unwrap();
|
write_keypair_file(&authority_keypair, &authority_keypair_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"deploy",
|
"deploy",
|
||||||
|
@ -2346,7 +2346,7 @@ mod tests {
|
||||||
&authority_keypair_file,
|
&authority_keypair_file,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
||||||
program_location: Some("/Users/test/program.so".to_string()),
|
program_location: Some("/Users/test/program.so".to_string()),
|
||||||
|
@ -2366,7 +2366,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"deploy",
|
"deploy",
|
||||||
|
@ -2374,7 +2374,7 @@ mod tests {
|
||||||
"--final",
|
"--final",
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
command: CliCommand::Program(ProgramCliCommand::Deploy {
|
||||||
program_location: Some("/Users/test/program.so".to_string()),
|
program_location: Some("/Users/test/program.so".to_string()),
|
||||||
|
@ -2406,14 +2406,14 @@ mod tests {
|
||||||
};
|
};
|
||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"write-buffer",
|
"write-buffer",
|
||||||
"/Users/test/program.so",
|
"/Users/test/program.so",
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
||||||
program_location: "/Users/test/program.so".to_string(),
|
program_location: "/Users/test/program.so".to_string(),
|
||||||
|
@ -2427,7 +2427,7 @@ mod tests {
|
||||||
);
|
);
|
||||||
|
|
||||||
// specify max len
|
// specify max len
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"write-buffer",
|
"write-buffer",
|
||||||
|
@ -2436,7 +2436,7 @@ mod tests {
|
||||||
"42",
|
"42",
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
||||||
program_location: "/Users/test/program.so".to_string(),
|
program_location: "/Users/test/program.so".to_string(),
|
||||||
|
@ -2453,7 +2453,7 @@ mod tests {
|
||||||
let buffer_keypair = Keypair::new();
|
let buffer_keypair = Keypair::new();
|
||||||
let buffer_keypair_file = make_tmp_path("buffer_keypair_file");
|
let buffer_keypair_file = make_tmp_path("buffer_keypair_file");
|
||||||
write_keypair_file(&buffer_keypair, &buffer_keypair_file).unwrap();
|
write_keypair_file(&buffer_keypair, &buffer_keypair_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"write-buffer",
|
"write-buffer",
|
||||||
|
@ -2462,7 +2462,7 @@ mod tests {
|
||||||
&buffer_keypair_file,
|
&buffer_keypair_file,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
||||||
program_location: "/Users/test/program.so".to_string(),
|
program_location: "/Users/test/program.so".to_string(),
|
||||||
|
@ -2482,7 +2482,7 @@ mod tests {
|
||||||
let authority_keypair = Keypair::new();
|
let authority_keypair = Keypair::new();
|
||||||
let authority_keypair_file = make_tmp_path("authority_keypair_file");
|
let authority_keypair_file = make_tmp_path("authority_keypair_file");
|
||||||
write_keypair_file(&authority_keypair, &authority_keypair_file).unwrap();
|
write_keypair_file(&authority_keypair, &authority_keypair_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"write-buffer",
|
"write-buffer",
|
||||||
|
@ -2491,7 +2491,7 @@ mod tests {
|
||||||
&authority_keypair_file,
|
&authority_keypair_file,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
||||||
program_location: "/Users/test/program.so".to_string(),
|
program_location: "/Users/test/program.so".to_string(),
|
||||||
|
@ -2514,7 +2514,7 @@ mod tests {
|
||||||
let authority_keypair = Keypair::new();
|
let authority_keypair = Keypair::new();
|
||||||
let authority_keypair_file = make_tmp_path("authority_keypair_file");
|
let authority_keypair_file = make_tmp_path("authority_keypair_file");
|
||||||
write_keypair_file(&authority_keypair, &authority_keypair_file).unwrap();
|
write_keypair_file(&authority_keypair, &authority_keypair_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"write-buffer",
|
"write-buffer",
|
||||||
|
@ -2525,7 +2525,7 @@ mod tests {
|
||||||
&authority_keypair_file,
|
&authority_keypair_file,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
command: CliCommand::Program(ProgramCliCommand::WriteBuffer {
|
||||||
program_location: "/Users/test/program.so".to_string(),
|
program_location: "/Users/test/program.so".to_string(),
|
||||||
|
@ -2558,7 +2558,7 @@ mod tests {
|
||||||
|
|
||||||
let program_pubkey = Pubkey::new_unique();
|
let program_pubkey = Pubkey::new_unique();
|
||||||
let new_authority_pubkey = Pubkey::new_unique();
|
let new_authority_pubkey = Pubkey::new_unique();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"set-upgrade-authority",
|
"set-upgrade-authority",
|
||||||
|
@ -2567,7 +2567,7 @@ mod tests {
|
||||||
&new_authority_pubkey.to_string(),
|
&new_authority_pubkey.to_string(),
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::SetUpgradeAuthority {
|
command: CliCommand::Program(ProgramCliCommand::SetUpgradeAuthority {
|
||||||
program_pubkey,
|
program_pubkey,
|
||||||
|
@ -2582,7 +2582,7 @@ mod tests {
|
||||||
let new_authority_pubkey = Keypair::new();
|
let new_authority_pubkey = Keypair::new();
|
||||||
let new_authority_pubkey_file = make_tmp_path("authority_keypair_file");
|
let new_authority_pubkey_file = make_tmp_path("authority_keypair_file");
|
||||||
write_keypair_file(&new_authority_pubkey, &new_authority_pubkey_file).unwrap();
|
write_keypair_file(&new_authority_pubkey, &new_authority_pubkey_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"set-upgrade-authority",
|
"set-upgrade-authority",
|
||||||
|
@ -2591,7 +2591,7 @@ mod tests {
|
||||||
&new_authority_pubkey_file,
|
&new_authority_pubkey_file,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::SetUpgradeAuthority {
|
command: CliCommand::Program(ProgramCliCommand::SetUpgradeAuthority {
|
||||||
program_pubkey,
|
program_pubkey,
|
||||||
|
@ -2606,7 +2606,7 @@ mod tests {
|
||||||
let new_authority_pubkey = Keypair::new();
|
let new_authority_pubkey = Keypair::new();
|
||||||
let new_authority_pubkey_file = make_tmp_path("authority_keypair_file");
|
let new_authority_pubkey_file = make_tmp_path("authority_keypair_file");
|
||||||
write_keypair_file(&new_authority_pubkey, &new_authority_pubkey_file).unwrap();
|
write_keypair_file(&new_authority_pubkey, &new_authority_pubkey_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"set-upgrade-authority",
|
"set-upgrade-authority",
|
||||||
|
@ -2614,7 +2614,7 @@ mod tests {
|
||||||
"--final",
|
"--final",
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::SetUpgradeAuthority {
|
command: CliCommand::Program(ProgramCliCommand::SetUpgradeAuthority {
|
||||||
program_pubkey,
|
program_pubkey,
|
||||||
|
@ -2629,7 +2629,7 @@ mod tests {
|
||||||
let authority = Keypair::new();
|
let authority = Keypair::new();
|
||||||
let authority_keypair_file = make_tmp_path("authority_keypair_file");
|
let authority_keypair_file = make_tmp_path("authority_keypair_file");
|
||||||
write_keypair_file(&authority, &authority_keypair_file).unwrap();
|
write_keypair_file(&authority, &authority_keypair_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"set-upgrade-authority",
|
"set-upgrade-authority",
|
||||||
|
@ -2639,7 +2639,7 @@ mod tests {
|
||||||
"--final",
|
"--final",
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::SetUpgradeAuthority {
|
command: CliCommand::Program(ProgramCliCommand::SetUpgradeAuthority {
|
||||||
program_pubkey,
|
program_pubkey,
|
||||||
|
@ -2669,7 +2669,7 @@ mod tests {
|
||||||
|
|
||||||
let buffer_pubkey = Pubkey::new_unique();
|
let buffer_pubkey = Pubkey::new_unique();
|
||||||
let new_authority_pubkey = Pubkey::new_unique();
|
let new_authority_pubkey = Pubkey::new_unique();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"set-buffer-authority",
|
"set-buffer-authority",
|
||||||
|
@ -2678,7 +2678,7 @@ mod tests {
|
||||||
&new_authority_pubkey.to_string(),
|
&new_authority_pubkey.to_string(),
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::SetBufferAuthority {
|
command: CliCommand::Program(ProgramCliCommand::SetBufferAuthority {
|
||||||
buffer_pubkey,
|
buffer_pubkey,
|
||||||
|
@ -2693,7 +2693,7 @@ mod tests {
|
||||||
let new_authority_keypair = Keypair::new();
|
let new_authority_keypair = Keypair::new();
|
||||||
let new_authority_keypair_file = make_tmp_path("authority_keypair_file");
|
let new_authority_keypair_file = make_tmp_path("authority_keypair_file");
|
||||||
write_keypair_file(&new_authority_keypair, &new_authority_keypair_file).unwrap();
|
write_keypair_file(&new_authority_keypair, &new_authority_keypair_file).unwrap();
|
||||||
let test_deploy = test_commands.clone().get_matches_from(vec![
|
let test_command = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"program",
|
"program",
|
||||||
"set-buffer-authority",
|
"set-buffer-authority",
|
||||||
|
@ -2702,7 +2702,7 @@ mod tests {
|
||||||
&new_authority_keypair_file,
|
&new_authority_keypair_file,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_deploy, &default_signer, &mut None).unwrap(),
|
parse_command(&test_command, &default_signer, &mut None).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
command: CliCommand::Program(ProgramCliCommand::SetBufferAuthority {
|
command: CliCommand::Program(ProgramCliCommand::SetBufferAuthority {
|
||||||
buffer_pubkey,
|
buffer_pubkey,
|
||||||
|
|
Loading…
Reference in New Issue