Skip to content

Commit

Permalink
Adds test coverage for solana-labs#20669
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Oct 14, 2021
1 parent bbc0bb4 commit 13a180c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,21 @@ mod tests {
assert_eq!(elf[i], *byte);
}

// Invoke deployed program
{
let programdata_account = RefCell::new(post_programdata_account);
let program_account = RefCell::new(post_program_account);
let program_address = program_keypair.pubkey();
let keyed_accounts: Vec<KeyedAccountTuple> = vec![
(false, false, &programdata_address, &programdata_account),
(false, false, &program_address, &program_account),
];
assert_eq!(
Ok(()),
process_instruction(&program_address, &[], &keyed_accounts),
);
}

// Test initialized program account
bank.clear_signatures();
bank.store_account(&buffer_address, &buffer_account);
Expand Down Expand Up @@ -3386,7 +3401,7 @@ mod tests {
];
assert_eq!(
Err(InstructionError::InvalidAccountData),
process_instruction(&program_address, &instruction, &keyed_accounts),
process_instruction(&program_address, &[], &keyed_accounts),
);
}

Expand Down

0 comments on commit 13a180c

Please sign in to comment.