-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Define ClusterConfig::new_with_equal_stakes() #32330
Conversation
Codecov Report
@@ Coverage Diff @@
## master #32330 +/- ##
=======================================
Coverage 82.0% 82.1%
=======================================
Files 773 773
Lines 209748 209748
=======================================
+ Hits 172180 172216 +36
+ Misses 37568 37532 -36 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple nits
@@ -93,6 +93,25 @@ pub struct ClusterConfig { | |||
pub tpu_connection_pool_size: usize, | |||
} | |||
|
|||
impl ClusterConfig { | |||
pub fn new_with_equal_stakes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does / should this be pub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems so... even pub(crate)
didn't work (tested at #31239):
error[E0624]: associated function `new_with_equal_stakes` is private
--> local-cluster/tests/local_cluster.rs:3038:37
|
3038 | let mut config = ClusterConfig::new_with_equal_stakes(
| ^^^^^^^^^^^^^^^^^^^^^ private associated function
|
::: /home/ryoqun/work/solana/for-merge/local-cluster/src/local_cluster.rs:96:5
|
96 | / pub(crate) fn new_with_equal_stakes(
97 | | num_nodes: usize,
98 | | cluster_lamports: u64,
99 | | lamports_per_node: u64,
100 | | ) -> Self {
| |_____________- private associated function defined here
For more information about this error, try `rustc --explain E0624`.
error: could not compile `solana-local-cluster` (test "local_cluster") due to previous error
warning: build failed, waiting for other jobs to finish...
local-cluster/src/local_cluster.rs
Outdated
let stakes: Vec<_> = vec![lamports_per_node; num_nodes]; | ||
Self { | ||
node_stakes: stakes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
realize it was just moved, but let's do a tactical rename in this PR:
let stakes: Vec<_> = vec![lamports_per_node; num_nodes]; | |
Self { | |
node_stakes: stakes, | |
let node_stakes = vec![lamports_per_node; num_nodes]; | |
Self { | |
node_stakes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about this? 0d5e602 better, imo. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Problem
another small refactor for #31239 per #31239 (comment)
Summary of Changes
Fixes #