add authorities to stake init (#6104)

* add authorities to stake init

* fixups

* code review
This commit is contained in:
Rob Walker
2019-09-26 13:29:29 -07:00
committed by GitHub
parent 50bbe34b66
commit a964570b1a
10 changed files with 371 additions and 213 deletions

View File

@ -319,18 +319,20 @@ mod tests {
mut genesis_block, ..
} = create_genesis_block(10_000);
let sk1 = Pubkey::new_rand();
let pk1 = Pubkey::new_rand();
let mut vote_account1 = vote_state::create_account(&pk1, &Pubkey::new_rand(), 0, 100);
let stake_account1 = stake_state::create_account(&pk1, &vote_account1, 100);
let stake_account1 = stake_state::create_account(&sk1, &pk1, &vote_account1, 100);
let sk2 = Pubkey::new_rand();
let pk2 = Pubkey::new_rand();
let mut vote_account2 = vote_state::create_account(&pk2, &Pubkey::new_rand(), 0, 50);
let stake_account2 = stake_state::create_account(&pk2, &vote_account2, 50);
let stake_account2 = stake_state::create_account(&sk2, &pk2, &vote_account2, 50);
genesis_block.accounts.extend(vec![
(pk1, vote_account1.clone()),
(Pubkey::new_rand(), stake_account1),
(sk1, stake_account1),
(pk2, vote_account2.clone()),
(Pubkey::new_rand(), stake_account2),
(sk2, stake_account2),
]);
// Create bank

View File

@ -104,7 +104,10 @@ pub(crate) mod tests {
sysvar::stake_history::{self, StakeHistory},
transaction::Transaction,
};
use solana_stake_api::{stake_instruction, stake_state::Stake};
use solana_stake_api::{
stake_instruction,
stake_state::{Authorized, Stake},
};
use solana_vote_api::{vote_instruction, vote_state::VoteInit};
use std::sync::Arc;
@ -160,6 +163,7 @@ pub(crate) mod tests {
&stake_account_pubkey,
vote_pubkey,
amount,
&Authorized::auto(&stake_account_pubkey),
),
);
}