Skip to content

Commit

Permalink
add dcou to apply_votes_to_tower
Browse files Browse the repository at this point in the history
  • Loading branch information
yihau committed Jun 24, 2024
1 parent 2443048 commit 411a713
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions local-cluster/src/cluster_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ use {
rand::{thread_rng, Rng},
rayon::{prelude::*, ThreadPool},
solana_client::connection_cache::{ConnectionCache, Protocol},
solana_core::consensus::{
tower_storage::{FileTowerStorage, SavedTower, SavedTowerVersions, TowerStorage},
VOTE_THRESHOLD_DEPTH,
},
solana_core::consensus::VOTE_THRESHOLD_DEPTH,
solana_entry::entry::{self, Entry, EntrySlice},
solana_gossip::{
cluster_info::{self, ClusterInfo},
Expand Down Expand Up @@ -44,7 +41,7 @@ use {
std::{
collections::{HashMap, HashSet, VecDeque},
net::{IpAddr, Ipv4Addr, SocketAddr, TcpListener},
path::{Path, PathBuf},
path::Path,
sync::{
atomic::{AtomicBool, Ordering},
Arc, RwLock,
Expand All @@ -54,6 +51,14 @@ use {
},
};

#[cfg(feature = "dev-context-only-utils")]
use {
solana_core::consensus::tower_storage::{
FileTowerStorage, SavedTower, SavedTowerVersions, TowerStorage,
},
std::path::PathBuf,
};

pub fn get_client_facing_addr(
protocol: Protocol,
contact_info: &ContactInfo,
Expand Down Expand Up @@ -348,6 +353,7 @@ pub fn kill_entry_and_spend_and_verify_rest(
}
}

#[cfg(feature = "dev-context-only-utils")]
pub fn apply_votes_to_tower(node_keypair: &Keypair, votes: Vec<(Slot, Hash)>, tower_path: PathBuf) {
let tower_storage = FileTowerStorage::new(tower_path);
let mut tower = tower_storage.load(&node_keypair.pubkey()).unwrap();
Expand Down

0 comments on commit 411a713

Please sign in to comment.