Skip to content

Commit

Permalink
refactor: use a more descriptive variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
douglaz committed Jul 26, 2023
1 parent 240946d commit 2e76758
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions fedimint-server/src/config/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,22 +962,22 @@ mod tests {
let leader_amount = leader.amount;
let leader_name = leader.name.clone();
followers.push(leader);
let followers = Arc::new(followers);
let all_peers = Arc::new(followers);
let (results, _) = tokio::join!(
join_all(
followers
all_peers
.iter()
.map(|peer| peer.client.run_dkg(peer.auth.clone()))
),
followers[0].wait_status(ServerStatus::ReadyForConfigGen)
all_peers[0].wait_status(ServerStatus::ReadyForConfigGen)
);
for result in results {
result.expect("DKG failed");
}

// verify config hashes equal for all peers
let mut hashes = HashSet::new();
for peer in followers.iter() {
for peer in all_peers.iter() {
peer.wait_status(ServerStatus::VerifyingConfigs).await;
hashes.insert(
peer.client
Expand All @@ -989,7 +989,7 @@ mod tests {
assert_eq!(hashes.len(), 1);

// verify the local and consensus values for peers
for peer in followers.iter() {
for peer in all_peers.iter() {
let cfg = peer.read_config();
let dummy: DummyConfig = cfg.get_module_config_typed(0).unwrap();
assert_eq!(dummy.consensus.tx_fee, leader_amount);
Expand All @@ -998,17 +998,17 @@ mod tests {
}

// start consensus
for peer in followers.iter() {
for peer in all_peers.iter() {
peer.client.start_consensus(peer.auth.clone()).await.ok();
assert_eq!(peer.status().await.server, ServerStatus::ConsensusRunning);
}

// shutdown
for peer in followers.iter() {
for peer in all_peers.iter() {
peer.retry_signal_upgrade().await;
}

followers
all_peers
};

// Run the Fedimint servers and test concurrently
Expand Down

0 comments on commit 2e76758

Please sign in to comment.