Cherry-pick vote and stake authority changes (#6127)

* add authorized parameters to vote api (#6072)

* add authorized parameters to vote api

* code review

* add authorities to stake init (#6104)

* add authorities to stake init

* fixups

* code review
This commit is contained in:
Tyera Eulberg
2019-09-26 17:18:31 -06:00
committed by GitHub
parent 232d2b3899
commit 61930c0dd3
14 changed files with 947 additions and 428 deletions

View File

@@ -1584,7 +1584,7 @@ mod tests {
use solana_sdk::sysvar::{fees::Fees, rewards::Rewards};
use solana_stake_api::stake_state::Stake;
use solana_vote_api::vote_instruction;
use solana_vote_api::vote_state::{VoteState, MAX_LOCKOUT_HISTORY};
use solana_vote_api::vote_state::{VoteInit, VoteState, MAX_LOCKOUT_HISTORY};
use std::io::Cursor;
use std::time::Duration;
use tempfile::TempDir;
@@ -2861,8 +2861,12 @@ mod tests {
let instructions = vote_instruction::create_account(
&mint_keypair.pubkey(),
&vote_keypair.pubkey(),
&mint_keypair.pubkey(),
0,
&VoteInit {
node_pubkey: mint_keypair.pubkey(),
authorized_voter: vote_keypair.pubkey(),
authorized_withdrawer: vote_keypair.pubkey(),
commission: 0,
},
10,
);

View File

@@ -41,6 +41,7 @@ pub fn create_genesis_block_with_leader(
);
let stake_account = stake_state::create_account(
&staking_keypair.pubkey(),
&voting_keypair.pubkey(),
&vote_account,
bootstrap_leader_stake_lamports,

View File

@@ -220,9 +220,11 @@ pub mod tests {
// add stake to a vote_pubkey ( stake )
pub fn create_stake_account(stake: u64, vote_pubkey: &Pubkey) -> (Pubkey, Account) {
let stake_pubkey = Pubkey::new_rand();
(
Pubkey::new_rand(),
stake_pubkey,
stake_state::create_account(
&stake_pubkey,
&vote_pubkey,
&vote_state::create_account(&vote_pubkey, &Pubkey::new_rand(), 0, 1),
stake,