Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions program/tests/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ fn fully_configurable_stake(
}
}

// test all unmodified transactions succeed, to ensure other tests test what they purport to test
#[test]
fn test_all_success() {
let mut env = Env::init();
Expand All @@ -912,6 +913,7 @@ fn test_all_success() {
}
}

// all signers are essential; missing any one signer is a fail
#[test]
fn test_no_signer_bypass() {
let mut env = Env::init();
Expand All @@ -930,3 +932,23 @@ fn test_no_signer_bypass() {
}
}
}

// the stake program cannot be used during the epoch rewards period
// the only exception to this is GetMinimumDelegation
#[test]
fn test_epoch_rewards_period() {
let mut env = Env::init();
env.mollusk.sysvars.epoch_rewards = EpochRewards {
active: true,
..EpochRewards::default()
};

for declaration in &*INSTRUCTION_DECLARATIONS {
let instruction = declaration.to_instruction(&mut env);
env.process_fail(&instruction);
env.reset();
}

let instruction = instruction::get_minimum_delegation();
env.process_success(&instruction);
}