program-test: Fix warp and staking issue (#16002)

Since program-test creates a test genesis and then adds fees and rent,
some of the genesis accounts get rent-collected after warping.  Most
notably, `StakeConfig` gets rent-collected, causing any stake operations
to fail after warp.  This fix creates genesis with the `Rent` and
`FeeRateGovernor` actually used by the bank.
This commit is contained in:
Jon Cinque
2021-03-19 14:37:13 +01:00
committed by GitHub
parent 2cd875f8e0
commit 6cc22e62d4
2 changed files with 41 additions and 14 deletions

View File

@ -164,6 +164,8 @@ async fn stake_rewards_from_warp() {
let program_test = ProgramTest::default();
let mut context = program_test.start_with_context().await;
// warp once to make sure stake config doesn't get rent-collected
context.warp_to_slot(100).unwrap();
let mut instructions = vec![];
let validator_keypair = Keypair::new();
instructions.push(system_instruction::create_account(