Skip to content

Commit

Permalink
add move to omnibus instruction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
2501babe committed Jun 5, 2024
1 parent 316215e commit 2b24676
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions programs/stake/src/stake_instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,26 @@ mod tests {
),
Err(InstructionError::InvalidAccountData),
);
process_instruction_as_one_arg(
Arc::clone(&feature_set),
&instruction::move_stake(
&Pubkey::new_unique(),
&Pubkey::new_unique(),
&Pubkey::new_unique(),
100,
),
Err(InstructionError::InvalidAccountData),
);
process_instruction_as_one_arg(
Arc::clone(&feature_set),
&instruction::move_lamports(
&Pubkey::new_unique(),
&Pubkey::new_unique(),
&Pubkey::new_unique(),
100,
),
Err(InstructionError::InvalidAccountData),
);
}

#[test_case(feature_set_no_minimum_delegation(); "no_min_delegation")]
Expand Down Expand Up @@ -848,6 +868,26 @@ mod tests {
)[2],
Err(InstructionError::InvalidAccountOwner),
);
process_instruction_as_one_arg(
Arc::clone(&feature_set),
&instruction::move_stake(
&spoofed_stake_state_pubkey(),
&Pubkey::new_unique(),
&Pubkey::new_unique(),
100,
),
Err(InstructionError::InvalidAccountOwner),
);
process_instruction_as_one_arg(
Arc::clone(&feature_set),
&instruction::move_lamports(
&spoofed_stake_state_pubkey(),
&Pubkey::new_unique(),
&Pubkey::new_unique(),
100,
),
Err(InstructionError::InvalidAccountOwner),
);
}

#[test_case(feature_set_no_minimum_delegation(); "no_min_delegation")]
Expand Down Expand Up @@ -8079,6 +8119,26 @@ mod tests {
)[2],
Err(StakeError::EpochRewardsActive.into()),
);
process_instruction_as_one_arg(
Arc::clone(&feature_set),
&instruction::move_stake(
&Pubkey::new_unique(),
&Pubkey::new_unique(),
&Pubkey::new_unique(),
100,
),
Err(StakeError::EpochRewardsActive.into()),
);
process_instruction_as_one_arg(
Arc::clone(&feature_set),
&instruction::move_lamports(
&Pubkey::new_unique(),
&Pubkey::new_unique(),
&Pubkey::new_unique(),
100,
),
Err(StakeError::EpochRewardsActive.into()),
);

// Only GetMinimumDelegation should not return StakeError::EpochRewardsActive
process_instruction_as_one_arg(
Expand Down

0 comments on commit 2b24676

Please sign in to comment.