diff --git a/program/tests/interface.rs b/program/tests/interface.rs index f3d106c5..d3e36ba2 100644 --- a/program/tests/interface.rs +++ b/program/tests/interface.rs @@ -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(); @@ -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(); @@ -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); +}