Add test to enforce that program id account info for CPI is optional (#22069)
* Update tests to demonstrate that program id account info for CPI is optional * Clean up comments that say that program id account info is required
This commit is contained in:
@ -8,13 +8,12 @@ use solana_program::{
|
||||
|
||||
entrypoint!(process_instruction);
|
||||
fn process_instruction(
|
||||
program_id: &Pubkey,
|
||||
_program_id: &Pubkey,
|
||||
accounts: &[AccountInfo],
|
||||
_instruction_data: &[u8],
|
||||
) -> ProgramResult {
|
||||
msg!("Upgradeable program");
|
||||
assert_eq!(accounts.len(), 2);
|
||||
assert_eq!(accounts[0].key, program_id);
|
||||
assert_eq!(*accounts[1].key, clock::id());
|
||||
assert_eq!(accounts.len(), 1);
|
||||
assert_eq!(*accounts[0].key, clock::id());
|
||||
Err(42.into())
|
||||
}
|
||||
|
Reference in New Issue
Block a user