From 8f8b18025fa6919aacf501f897eba66074add380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Fri, 19 Jul 2024 21:03:07 +0200 Subject: [PATCH] Adjusts tests. --- programs/sbf/tests/programs.rs | 5 +---- runtime/src/bank/tests.rs | 16 ++++++---------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/programs/sbf/tests/programs.rs b/programs/sbf/tests/programs.rs index cbce0145371154..17d3e56d42229f 100644 --- a/programs/sbf/tests/programs.rs +++ b/programs/sbf/tests/programs.rs @@ -1210,10 +1210,7 @@ fn test_program_sbf_caller_has_access_to_cpi_program() { ]; let instruction = Instruction::new_with_bytes(caller_pubkey, &[1], account_metas.clone()); let result = bank_client.send_and_confirm_instruction(&mint_keypair, instruction); - assert_eq!( - result.unwrap_err().unwrap(), - TransactionError::InstructionError(0, InstructionError::MissingAccount) - ); + assert!(result.is_ok()); } #[test] diff --git a/runtime/src/bank/tests.rs b/runtime/src/bank/tests.rs index 674bd4e39717b9..9d2be9c3f23483 100644 --- a/runtime/src/bank/tests.rs +++ b/runtime/src/bank/tests.rs @@ -7658,16 +7658,12 @@ fn test_bpf_loader_upgradeable_deploy_with_max_len() { .get_mut(6) .unwrap() = AccountMeta::new_readonly(Pubkey::new_unique(), false); let message = Message::new(&instructions, Some(&mint_keypair.pubkey())); - assert_eq!( - TransactionError::InstructionError(1, InstructionError::MissingAccount), - bank_client - .send_and_confirm_message( - &[&mint_keypair, &program_keypair, &upgrade_authority_keypair], - message - ) - .unwrap_err() - .unwrap() - ); + assert!(bank_client + .send_and_confirm_message( + &[&mint_keypair, &program_keypair, &upgrade_authority_keypair], + message + ) + .is_ok()); fn truncate_data(account: &mut AccountSharedData, len: usize) { let mut data = account.data().to_vec();