From 79d9c92f9bbe8edb37b03029053599bdcebb2095 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 28 Jan 2021 22:16:05 +0000 Subject: [PATCH] Manually camelCase solana program json (bp #14907) (#14909) * Manually camelCase solana program json (#14907) (cherry picked from commit 7e2e0d4a864a2f141005c218e5b35036d78298aa) # Conflicts: # cli/src/program.rs # cli/tests/program.rs * Fix conflicts Co-authored-by: Tyera Eulberg Co-authored-by: Tyera Eulberg --- cli/src/cli.rs | 2 +- cli/src/program.rs | 10 +++++----- cli/tests/program.rs | 34 +++++++++++++++++----------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 93c9438e26..ce3752792e 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -2725,7 +2725,7 @@ mod tests { let program_id = json .as_object() .unwrap() - .get("ProgramId") + .get("programId") .unwrap() .as_str() .unwrap(); diff --git a/cli/src/program.rs b/cli/src/program.rs index 96cdef80a2..0153ad3bb0 100644 --- a/cli/src/program.rs +++ b/cli/src/program.rs @@ -866,11 +866,11 @@ fn process_set_authority( match new_authority { Some(pubkey) => Ok(json!({ - "Authority": format!("{:?}", pubkey), + "authority": format!("{:?}", pubkey), }) .to_string()), None => Ok(json!({ - "Authority": "None", + "authority": "none", }) .to_string()), } @@ -1076,12 +1076,12 @@ fn do_process_program_write_and_deploy( if let Some(program_signer) = program_signer { Ok(json!({ - "ProgramId": format!("{}", program_signer.pubkey()), + "programId": format!("{}", program_signer.pubkey()), }) .to_string()) } else { Ok(json!({ - "Buffer": format!("{}", buffer_pubkey), + "buffer": format!("{}", buffer_pubkey), }) .to_string()) } @@ -2272,7 +2272,7 @@ mod tests { let program_id = json .as_object() .unwrap() - .get("ProgramId") + .get("programId") .unwrap() .as_str() .unwrap(); diff --git a/cli/tests/program.rs b/cli/tests/program.rs index 65ec5bc847..16fb675ce8 100644 --- a/cli/tests/program.rs +++ b/cli/tests/program.rs @@ -77,7 +77,7 @@ fn test_cli_program_deploy_non_upgradeable() { let program_id_str = json .as_object() .unwrap() - .get("ProgramId") + .get("programId") .unwrap() .as_str() .unwrap(); @@ -221,7 +221,7 @@ fn test_cli_program_deploy_no_authority() { let program_id_str = json .as_object() .unwrap() - .get("ProgramId") + .get("programId") .unwrap() .as_str() .unwrap(); @@ -318,7 +318,7 @@ fn test_cli_program_deploy_with_authority() { let program_pubkey_str = json .as_object() .unwrap() - .get("ProgramId") + .get("programId") .unwrap() .as_str() .unwrap(); @@ -365,7 +365,7 @@ fn test_cli_program_deploy_with_authority() { let program_pubkey_str = json .as_object() .unwrap() - .get("ProgramId") + .get("programId") .unwrap() .as_str() .unwrap(); @@ -434,7 +434,7 @@ fn test_cli_program_deploy_with_authority() { let new_upgrade_authority_str = json .as_object() .unwrap() - .get("Authority") + .get("authority") .unwrap() .as_str() .unwrap(); @@ -488,11 +488,11 @@ fn test_cli_program_deploy_with_authority() { let new_upgrade_authority_str = json .as_object() .unwrap() - .get("Authority") + .get("authority") .unwrap() .as_str() .unwrap(); - assert_eq!(new_upgrade_authority_str, "None"); + assert_eq!(new_upgrade_authority_str, "none"); // Upgrade with no authority config.signers = vec![&keypair, &new_upgrade_authority]; @@ -529,7 +529,7 @@ fn test_cli_program_deploy_with_authority() { let program_pubkey_str = json .as_object() .unwrap() - .get("ProgramId") + .get("programId") .unwrap() .as_str() .unwrap(); @@ -618,7 +618,7 @@ fn test_cli_program_write_buffer() { let buffer_pubkey_str = json .as_object() .unwrap() - .get("Buffer") + .get("buffer") .unwrap() .as_str() .unwrap(); @@ -652,7 +652,7 @@ fn test_cli_program_write_buffer() { let buffer_pubkey_str = json .as_object() .unwrap() - .get("Buffer") + .get("buffer") .unwrap() .as_str() .unwrap(); @@ -690,7 +690,7 @@ fn test_cli_program_write_buffer() { let buffer_pubkey_str = json .as_object() .unwrap() - .get("Buffer") + .get("buffer") .unwrap() .as_str() .unwrap(); @@ -728,7 +728,7 @@ fn test_cli_program_write_buffer() { let buffer_pubkey_str = json .as_object() .unwrap() - .get("Buffer") + .get("buffer") .unwrap() .as_str() .unwrap(); @@ -763,7 +763,7 @@ fn test_cli_program_write_buffer() { let buffer_pubkey_str = json .as_object() .unwrap() - .get("Buffer") + .get("buffer") .unwrap() .as_str() .unwrap(); @@ -858,7 +858,7 @@ fn test_cli_program_set_buffer_authority() { let new_buffer_authority_str = json .as_object() .unwrap() - .get("Authority") + .get("authority") .unwrap() .as_str() .unwrap(); @@ -885,7 +885,7 @@ fn test_cli_program_set_buffer_authority() { let buffer_authority_str = json .as_object() .unwrap() - .get("Authority") + .get("authority") .unwrap() .as_str() .unwrap(); @@ -912,11 +912,11 @@ fn test_cli_program_set_buffer_authority() { let buffer_authority_str = json .as_object() .unwrap() - .get("Authority") + .get("authority") .unwrap() .as_str() .unwrap(); - assert_eq!(buffer_authority_str, "None"); + assert_eq!(buffer_authority_str, "none"); let buffer_account = rpc_client.get_account(&buffer_keypair.pubkey()).unwrap(); if let UpgradeableLoaderState::Buffer { authority_address } = buffer_account.state().unwrap() { assert_eq!(authority_address, None);