* Manually camelCase solana program json (#14907)
(cherry picked from commit 7e2e0d4a86
)
# Conflicts:
# cli/src/program.rs
# cli/tests/program.rs
* Fix conflicts
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
@ -2725,7 +2725,7 @@ mod tests {
|
|||||||
let program_id = json
|
let program_id = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("ProgramId")
|
.get("programId")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -866,11 +866,11 @@ fn process_set_authority(
|
|||||||
|
|
||||||
match new_authority {
|
match new_authority {
|
||||||
Some(pubkey) => Ok(json!({
|
Some(pubkey) => Ok(json!({
|
||||||
"Authority": format!("{:?}", pubkey),
|
"authority": format!("{:?}", pubkey),
|
||||||
})
|
})
|
||||||
.to_string()),
|
.to_string()),
|
||||||
None => Ok(json!({
|
None => Ok(json!({
|
||||||
"Authority": "None",
|
"authority": "none",
|
||||||
})
|
})
|
||||||
.to_string()),
|
.to_string()),
|
||||||
}
|
}
|
||||||
@ -1076,12 +1076,12 @@ fn do_process_program_write_and_deploy(
|
|||||||
|
|
||||||
if let Some(program_signer) = program_signer {
|
if let Some(program_signer) = program_signer {
|
||||||
Ok(json!({
|
Ok(json!({
|
||||||
"ProgramId": format!("{}", program_signer.pubkey()),
|
"programId": format!("{}", program_signer.pubkey()),
|
||||||
})
|
})
|
||||||
.to_string())
|
.to_string())
|
||||||
} else {
|
} else {
|
||||||
Ok(json!({
|
Ok(json!({
|
||||||
"Buffer": format!("{}", buffer_pubkey),
|
"buffer": format!("{}", buffer_pubkey),
|
||||||
})
|
})
|
||||||
.to_string())
|
.to_string())
|
||||||
}
|
}
|
||||||
@ -2272,7 +2272,7 @@ mod tests {
|
|||||||
let program_id = json
|
let program_id = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("ProgramId")
|
.get("programId")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -77,7 +77,7 @@ fn test_cli_program_deploy_non_upgradeable() {
|
|||||||
let program_id_str = json
|
let program_id_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("ProgramId")
|
.get("programId")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -221,7 +221,7 @@ fn test_cli_program_deploy_no_authority() {
|
|||||||
let program_id_str = json
|
let program_id_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("ProgramId")
|
.get("programId")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -318,7 +318,7 @@ fn test_cli_program_deploy_with_authority() {
|
|||||||
let program_pubkey_str = json
|
let program_pubkey_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("ProgramId")
|
.get("programId")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -365,7 +365,7 @@ fn test_cli_program_deploy_with_authority() {
|
|||||||
let program_pubkey_str = json
|
let program_pubkey_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("ProgramId")
|
.get("programId")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -434,7 +434,7 @@ fn test_cli_program_deploy_with_authority() {
|
|||||||
let new_upgrade_authority_str = json
|
let new_upgrade_authority_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Authority")
|
.get("authority")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -488,11 +488,11 @@ fn test_cli_program_deploy_with_authority() {
|
|||||||
let new_upgrade_authority_str = json
|
let new_upgrade_authority_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Authority")
|
.get("authority")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(new_upgrade_authority_str, "None");
|
assert_eq!(new_upgrade_authority_str, "none");
|
||||||
|
|
||||||
// Upgrade with no authority
|
// Upgrade with no authority
|
||||||
config.signers = vec![&keypair, &new_upgrade_authority];
|
config.signers = vec![&keypair, &new_upgrade_authority];
|
||||||
@ -529,7 +529,7 @@ fn test_cli_program_deploy_with_authority() {
|
|||||||
let program_pubkey_str = json
|
let program_pubkey_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("ProgramId")
|
.get("programId")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -618,7 +618,7 @@ fn test_cli_program_write_buffer() {
|
|||||||
let buffer_pubkey_str = json
|
let buffer_pubkey_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Buffer")
|
.get("buffer")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -652,7 +652,7 @@ fn test_cli_program_write_buffer() {
|
|||||||
let buffer_pubkey_str = json
|
let buffer_pubkey_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Buffer")
|
.get("buffer")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -690,7 +690,7 @@ fn test_cli_program_write_buffer() {
|
|||||||
let buffer_pubkey_str = json
|
let buffer_pubkey_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Buffer")
|
.get("buffer")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -728,7 +728,7 @@ fn test_cli_program_write_buffer() {
|
|||||||
let buffer_pubkey_str = json
|
let buffer_pubkey_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Buffer")
|
.get("buffer")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -763,7 +763,7 @@ fn test_cli_program_write_buffer() {
|
|||||||
let buffer_pubkey_str = json
|
let buffer_pubkey_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Buffer")
|
.get("buffer")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -858,7 +858,7 @@ fn test_cli_program_set_buffer_authority() {
|
|||||||
let new_buffer_authority_str = json
|
let new_buffer_authority_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Authority")
|
.get("authority")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -885,7 +885,7 @@ fn test_cli_program_set_buffer_authority() {
|
|||||||
let buffer_authority_str = json
|
let buffer_authority_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Authority")
|
.get("authority")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -912,11 +912,11 @@ fn test_cli_program_set_buffer_authority() {
|
|||||||
let buffer_authority_str = json
|
let buffer_authority_str = json
|
||||||
.as_object()
|
.as_object()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get("Authority")
|
.get("authority")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(buffer_authority_str, "None");
|
assert_eq!(buffer_authority_str, "none");
|
||||||
let buffer_account = rpc_client.get_account(&buffer_keypair.pubkey()).unwrap();
|
let buffer_account = rpc_client.get_account(&buffer_keypair.pubkey()).unwrap();
|
||||||
if let UpgradeableLoaderState::Buffer { authority_address } = buffer_account.state().unwrap() {
|
if let UpgradeableLoaderState::Buffer { authority_address } = buffer_account.state().unwrap() {
|
||||||
assert_eq!(authority_address, None);
|
assert_eq!(authority_address, None);
|
||||||
|
Reference in New Issue
Block a user