pub fn decrease_validator_stake(
    program_id: &Pubkey,
    stake_pool: &Pubkey,
    staker: &Pubkey,
    stake_pool_withdraw_authority: &Pubkey,
    validator_list: &Pubkey,
    validator_stake: &Pubkey,
    transient_stake: &Pubkey,
    lamports: u64,
) -> Instruction {
    let accounts = vec![
        AccountMeta::new_readonly(*stake_pool, false),
        AccountMeta::new_readonly(*staker, true),
        AccountMeta::new_readonly(*stake_pool_withdraw_authority, false),
        AccountMeta::new_readonly(*validator_list, false),
        AccountMeta::new(*validator_stake, false),
        AccountMeta::new(*transient_stake, false),
        AccountMeta::new_readonly(sysvar::clock::id(), false),
        AccountMeta::new_readonly(sysvar::rent::id(), false),
        AccountMeta::new_readonly(system_program::id(), false),
        AccountMeta::new_readonly(stake_program::id(), false),
    ];
    Instruction {
        program_id: *program_id,
        accounts,
        data: StakePoolInstruction::DecreaseValidatorStake(lamports)
            .try_to_vec()
            .unwrap(),
    }
}
/// Creates `DecreaseValidatorStake` instruction (rebalance from validator account to
/// transient account)
Creates `DecreaseValidatorStake` instruction (rebalance from validator account to
transient account)
Creates ` DecreaseValidatorStake ` instruction ( rebalance from validator account to transient account )
pub fn decrease_validator_stake(
    program_id: &Pubkey,
    stake_pool: &Pubkey,
    staker: &Pubkey,
    stake_pool_withdraw_authority: &Pubkey,
    validator_list: &Pubkey,
    validator_stake: &Pubkey,
    transient_stake: &Pubkey,
    lamports: u64,
) -> Instruction {
    let accounts = vec![
        AccountMeta::new_readonly(*stake_pool, false),
        AccountMeta::new_readonly(*staker, true),
        AccountMeta::new_readonly(*stake_pool_withdraw_authority, false),
        AccountMeta::new_readonly(*validator_list, false),
        AccountMeta::new(*validator_stake, false),
        AccountMeta::new(*transient_stake, false),
        AccountMeta::new_readonly(sysvar::clock::id(), false),
        AccountMeta::new_readonly(sysvar::rent::id(), false),
        AccountMeta::new_readonly(system_program::id(), false),
        AccountMeta::new_readonly(stake_program::id(), false),
    ];
    Instruction {
        program_id: *program_id,
        accounts,
        data: StakePoolInstruction::DecreaseValidatorStake(lamports)
            .try_to_vec()
            .unwrap(),
    }
}
pub fn decrease_validator_stake ( program_id : & Pubkey , stake_pool : & Pubkey , staker : & Pubkey , stake_pool_withdraw_authority : & Pubkey , validator_list : & Pubkey , validator_stake : & Pubkey , transient_stake : & Pubkey , lamports : u64 , ) -> Instruction { let accounts = vec ! [ AccountMeta new_readonly ( stake_pool false ) AccountMeta new_readonly ( staker true ) AccountMeta new_readonly ( stake_pool_withdraw_authority false ) AccountMeta new_readonly ( validator_list false ) AccountMeta new ( validator_stake false ) AccountMeta new ( transient_stake false ) AccountMeta new_readonly ( sysvar clock id ( ) false ) AccountMeta new_readonly ( sysvar rent id ( ) false ) AccountMeta new_readonly ( system_program id ( ) false ) AccountMeta new_readonly ( stake_program id ( ) false ) ] ; Instruction { program_id : * program_id , accounts , data : StakePoolInstruction :: DecreaseValidatorStake ( lamports ) . try_to_vec ( ) . unwrap ( ) , } }
Creates `DecreaseValidatorStake` instruction (rebalance from validator account to
transient account)
Creates ` DecreaseValidatorStake ` instruction ( rebalance from validator account to transient account )
program_id
&Pubkey
stake_pool
&Pubkey
staker
&Pubkey
stake_pool_withdraw_authority
&Pubkey
validator_list
&Pubkey
validator_stake
&Pubkey
transient_stake
&Pubkey
lamports
u64
program_id
&Pubkey
stake_pool
&Pubkey
staker
&Pubkey
stake_pool_withdraw_authority
&Pubkey
validator_list
&Pubkey
validator_stake
&Pubkey
transient_stake
&Pubkey
lamports
u64