fix single node testnet, remove bootstrap vote (#5534)

This commit is contained in:
Rob Walker
2019-08-15 18:58:46 -07:00
committed by GitHub
parent 4ee212ae4c
commit 94f1132fb6
7 changed files with 34 additions and 58 deletions

View File

@@ -417,18 +417,16 @@ where
}
// utility function, used by Bank, tests, genesis
pub fn create_stake_account(
voter_pubkey: &Pubkey,
vote_state: &VoteState,
lamports: u64,
) -> Account {
pub fn create_account(voter_pubkey: &Pubkey, vote_account: &Account, lamports: u64) -> Account {
let mut stake_account = Account::new(lamports, std::mem::size_of::<StakeState>(), &id());
let vote_state = VoteState::from(vote_account).expect("vote_state");
stake_account
.set_state(&StakeState::Stake(Stake::new_bootstrap(
lamports,
voter_pubkey,
vote_state,
&vote_state,
)))
.expect("set_state");