Fix fragile tests in prep of stake rewrite pr (#13654)

* Fix fragile tests in prep of stake rewrite pr

* Restore BOOTSTRAP_VALIDATOR_LAMPORTS where appropriate

* Further clean up

* Further clean up

* Aligh with other call site change

* Remove false warn!

* fix ci!
This commit is contained in:
Ryo Onodera
2020-11-20 17:21:03 +09:00
committed by GitHub
parent 2cb006fa44
commit b74d7b5758
7 changed files with 34 additions and 24 deletions

View File

@@ -101,7 +101,7 @@ where
pub(crate) mod tests {
use super::*;
use crate::genesis_utils::{
create_genesis_config, GenesisConfigInfo, BOOTSTRAP_VALIDATOR_LAMPORTS,
bootstrap_validator_stake_lamports, create_genesis_config, GenesisConfigInfo,
};
use solana_sdk::{
account::from_account,
@@ -178,10 +178,10 @@ pub(crate) mod tests {
#[test]
fn test_epoch_stakes_and_lockouts() {
solana_logger::setup();
let stake = BOOTSTRAP_VALIDATOR_LAMPORTS * 100;
let stake = bootstrap_validator_stake_lamports();
let leader_stake = Stake {
delegation: Delegation {
stake: BOOTSTRAP_VALIDATOR_LAMPORTS,
stake: bootstrap_validator_stake_lamports(),
activation_epoch: std::u64::MAX, // mark as bootstrap
..Delegation::default()
},
@@ -194,7 +194,7 @@ pub(crate) mod tests {
genesis_config,
mint_keypair,
..
} = create_genesis_config(10_000);
} = create_genesis_config(10_000 * bootstrap_validator_stake_lamports());
let bank = Bank::new(&genesis_config);
let vote_account = Keypair::new();