Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion local-cluster/src/cluster_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use {
},
};

fn get_client_facing_addr(contact_info: &ContactInfo) -> (SocketAddr, SocketAddr) {
pub fn get_client_facing_addr(contact_info: &ContactInfo) -> (SocketAddr, SocketAddr) {
let (rpc, mut tpu) = contact_info.client_facing_addr();
// QUIC certificate authentication requires the IP Address to match. ContactInfo might have
// 0.0.0.0 as the IP instead of 127.0.0.1.
Expand Down
6 changes: 3 additions & 3 deletions local-cluster/src/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ impl LocalCluster {
mut voting_keypair: Option<Arc<Keypair>>,
socket_addr_space: SocketAddrSpace,
) -> Pubkey {
let (rpc, tpu) = self.entry_point_info.client_facing_addr();
let (rpc, tpu) = cluster_tests::get_client_facing_addr(&self.entry_point_info);
let client = ThinClient::new(rpc, tpu, self.connection_cache.clone());

// Must have enough tokens to fund vote account and set delegate
Expand Down Expand Up @@ -512,7 +512,7 @@ impl LocalCluster {
}

pub fn transfer(&self, source_keypair: &Keypair, dest_pubkey: &Pubkey, lamports: u64) -> u64 {
let (rpc, tpu) = self.entry_point_info.client_facing_addr();
let (rpc, tpu) = cluster_tests::get_client_facing_addr(&self.entry_point_info);
let client = ThinClient::new(rpc, tpu, self.connection_cache.clone());
Self::transfer_with_client(&client, source_keypair, dest_pubkey, lamports)
}
Expand Down Expand Up @@ -759,7 +759,7 @@ impl Cluster for LocalCluster {

fn get_validator_client(&self, pubkey: &Pubkey) -> Option<ThinClient> {
self.validators.get(pubkey).map(|f| {
let (rpc, tpu) = f.info.contact_info.client_facing_addr();
let (rpc, tpu) = cluster_tests::get_client_facing_addr(&f.info.contact_info);
ThinClient::new(rpc, tpu, self.connection_cache.clone())
})
}
Expand Down
4 changes: 2 additions & 2 deletions local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ fn test_local_cluster_signature_subscribe() {
.unwrap();
let non_bootstrap_info = cluster.get_contact_info(&non_bootstrap_id).unwrap();

let (rpc, tpu) = non_bootstrap_info.client_facing_addr();
let (rpc, tpu) = cluster_tests::get_client_facing_addr(non_bootstrap_info);
let tx_client = ThinClient::new(rpc, tpu, cluster.connection_cache.clone());

let (blockhash, _) = tx_client
Expand Down Expand Up @@ -418,7 +418,7 @@ fn test_mainnet_beta_cluster_type() {
.unwrap();
assert_eq!(cluster_nodes.len(), 1);

let (rpc, tpu) = cluster.entry_point_info.client_facing_addr();
let (rpc, tpu) = cluster_tests::get_client_facing_addr(&cluster.entry_point_info);
let client = ThinClient::new(rpc, tpu, cluster.connection_cache.clone());

// Programs that are available at epoch 0
Expand Down