Put empty accounts in the accounts list on load (#9840)

Indexing into accounts array does not match account_keys otherwise.
Also enforce program accounts not at index 0
Enforce at least 1 Read-write signing fee-payer account.
This commit is contained in:
sakridge
2020-05-01 17:23:33 -07:00
committed by GitHub
parent fc46a0d441
commit 894549f002
5 changed files with 196 additions and 61 deletions

View File

@ -137,14 +137,17 @@ fn test_stake_create_and_split_single_signature() {
Pubkey::create_with_seed(&staker_pubkey, "split_stake", &solana_stake_program::id())
.unwrap();
// Test split
let message = Message::new(&stake_instruction::split_with_seed(
&stake_address, // original
&staker_pubkey, // authorized
lamports / 2,
&split_stake_address, // new address
&staker_pubkey, // base
"split_stake", // seed
));
let message = Message::new_with_payer(
&stake_instruction::split_with_seed(
&stake_address, // original
&staker_pubkey, // authorized
lamports / 2,
&split_stake_address, // new address
&staker_pubkey, // base
"split_stake", // seed
),
Some(&staker_keypair.pubkey()),
);
assert!(bank_client
.send_message(&[&staker_keypair], message)