Skip to content

Commit

Permalink
Update local-cluster tests to work with higher minimum stake delegati…
Browse files Browse the repository at this point in the history
…on (#25023)
  • Loading branch information
brooksprumo authored May 6, 2022
1 parent 6636661 commit 195bb8b
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 84 deletions.
6 changes: 3 additions & 3 deletions local-cluster/src/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl LocalCluster {
create_stake_config_account(
1,
&stake_config::Config {
warmup_cooldown_rate: 1_000_000_000.0f64,
warmup_cooldown_rate: std::f64::MAX,
slash_penalty: std::u8::MAX,
},
),
Expand Down Expand Up @@ -568,8 +568,8 @@ impl LocalCluster {
let vote_account_pubkey = vote_account.pubkey();
let node_pubkey = from_account.pubkey();
info!(
"setup_vote_and_stake_accounts: {}, {}",
node_pubkey, vote_account_pubkey
"setup_vote_and_stake_accounts: {}, {}, amount: {}",
node_pubkey, vote_account_pubkey, amount,
);
let stake_account_keypair = Keypair::new();
let stake_account_pubkey = stake_account_keypair.pubkey();
Expand Down
4 changes: 4 additions & 0 deletions local-cluster/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use {
account::AccountSharedData,
clock::{self, Slot, DEFAULT_MS_PER_SLOT, DEFAULT_TICKS_PER_SLOT},
hash::Hash,
native_token::LAMPORTS_PER_SOL,
pubkey::Pubkey,
signature::{Keypair, Signer},
},
Expand All @@ -47,6 +48,9 @@ use {
pub const RUST_LOG_FILTER: &str =
"error,solana_core::replay_stage=warn,solana_local_cluster=info,local_cluster=info";

pub const DEFAULT_CLUSTER_LAMPORTS: u64 = 10_000_000 * LAMPORTS_PER_SOL;
pub const DEFAULT_NODE_STAKE: u64 = 10 * LAMPORTS_PER_SOL;

pub fn last_vote_in_tower(tower_path: &Path, node_pubkey: &Pubkey) -> Option<(Slot, Hash)> {
restore_tower(tower_path, node_pubkey).map(|tower| tower.last_voted_slot_hash().unwrap())
}
Expand Down
Loading

0 comments on commit 195bb8b

Please sign in to comment.