/// Creates `AddValidatorToPool` instruction (add new validator stake account to the pool)
Creates `AddValidatorToPool` instruction (add new validator stake account to the pool)
Creates ` AddValidatorToPool ` instruction ( add new validator stake account to the pool )
pub fn add_validator_to_pool(
    program_id: &Pubkey,
    stake_pool: &Pubkey,
    staker: &Pubkey,
    stake_pool_deposit: &Pubkey,
    stake_pool_withdraw: &Pubkey,
    validator_list: &Pubkey,
    stake_account: &Pubkey,
    pool_token_receiver: &Pubkey,
    pool_mint: &Pubkey,
    token_program_id: &Pubkey,
) -> Result<Instruction, ProgramError> {
    let accounts = vec![
        AccountMeta::new(*stake_pool, false),
        AccountMeta::new_readonly(*staker, true),
        AccountMeta::new_readonly(*stake_pool_deposit, false),
        AccountMeta::new_readonly(*stake_pool_withdraw, false),
        AccountMeta::new(*validator_list, false),
        AccountMeta::new(*stake_account, false),
        AccountMeta::new(*pool_token_receiver, false),
        AccountMeta::new(*pool_mint, false),
        AccountMeta::new_readonly(sysvar::clock::id(), false),
        AccountMeta::new_readonly(sysvar::stake_history::id(), false),
        AccountMeta::new_readonly(*token_program_id, false),
        AccountMeta::new_readonly(stake_program::id(), false),
    ];
    Ok(Instruction {
        program_id: *program_id,
        accounts,
        data: StakePoolInstruction::AddValidatorToPool.try_to_vec()?,
    })
}
pub fn add_validator_to_pool ( program_id : & Pubkey , stake_pool : & Pubkey , staker : & Pubkey , stake_pool_deposit : & Pubkey , stake_pool_withdraw : & Pubkey , validator_list : & Pubkey , stake_account : & Pubkey , pool_token_receiver : & Pubkey , pool_mint : & Pubkey , token_program_id : & Pubkey , ) -> Result < Instruction , ProgramError > { let accounts = vec ! [ AccountMeta new ( stake_pool false ) AccountMeta new_readonly ( staker true ) AccountMeta new_readonly ( stake_pool_deposit false ) AccountMeta new_readonly ( stake_pool_withdraw false ) AccountMeta new ( validator_list false ) AccountMeta new ( stake_account false ) AccountMeta new ( pool_token_receiver false ) AccountMeta new ( pool_mint false ) AccountMeta new_readonly ( sysvar clock id ( ) false ) AccountMeta new_readonly ( sysvar stake_history id ( ) false ) AccountMeta new_readonly ( token_program_id false ) AccountMeta new_readonly ( stake_program id ( ) false ) ] ; Ok ( Instruction { program_id : * program_id , accounts , data : StakePoolInstruction :: AddValidatorToPool . try_to_vec ( ) ? , } ) }
Creates `AddValidatorToPool` instruction (add new validator stake account to the pool)
Creates ` AddValidatorToPool ` instruction ( add new validator stake account to the pool )
program_id
&Pubkey
<not_specific>
stake_pool
&Pubkey
<not_specific>
staker
&Pubkey
<not_specific>
stake_pool_deposit
&Pubkey
<not_specific>
stake_pool_withdraw
&Pubkey
<not_specific>
validator_list
&Pubkey
<not_specific>
stake_account
&Pubkey
<not_specific>
pool_token_receiver
&Pubkey
<not_specific>
pool_mint
&Pubkey
<not_specific>
token_program_id
&Pubkey
<not_specific>