Skip to content

Commit

Permalink
fix query of protocol params
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Feb 7, 2024
1 parent c31951d commit 7be5724
Showing 1 changed file with 62 additions and 14 deletions.
76 changes: 62 additions & 14 deletions crates/apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ pub async fn query_protocol_parameters(
) {
let governance_parameters =
query_governance_parameters(context.client()).await;
display_line!(context.io(), "Governance Parameters\n");
display_line!(context.io(), "\nGovernance Parameters");
display_line!(
context.io(),
"{:4}Min. proposal fund: {}",
Expand Down Expand Up @@ -1414,7 +1414,7 @@ pub async fn query_protocol_parameters(
);

let pgf_parameters = query_pgf_parameters(context.client()).await;
display_line!(context.io(), "Public Goods Funding Parameters\n");
display_line!(context.io(), "\nPublic Goods Funding Parameters");
display_line!(
context.io(),
"{:4}Pgf inflation rate: {}",
Expand All @@ -1428,7 +1428,7 @@ pub async fn query_protocol_parameters(
pgf_parameters.stewards_inflation_rate
);

display_line!(context.io(), "Protocol parameters");
display_line!(context.io(), "\nProtocol parameters");
let key = param_storage::get_epoch_duration_storage_key();
let epoch_duration: EpochDuration =
query_storage_value(context.client(), &key)
Expand Down Expand Up @@ -1519,15 +1519,33 @@ pub async fn query_protocol_parameters(
let pos_params = query_pos_parameters(context.client()).await;
display_line!(
context.io(),
"{:4}Block proposer reward: {}",
"{:4}Pipeline length: {}",
"",
pos_params.block_proposer_reward
pos_params.pipeline_len
);
display_line!(
context.io(),
"{:4}Block vote reward: {}",
"{:4}Unbonding length: {}",
"",
pos_params.block_vote_reward
pos_params.unbonding_len
);
display_line!(
context.io(),
"{:4}Cubic slashing window length: {}",
"",
pos_params.cubic_slashing_window_length
);
display_line!(
context.io(),
"{:4}Max. consensus validator slots: {}",
"",
pos_params.max_validator_slots
);
display_line!(
context.io(),
"{:4}Validator stake threshold: {}",
"",
pos_params.validator_stake_threshold
);
display_line!(
context.io(),
Expand All @@ -1543,25 +1561,55 @@ pub async fn query_protocol_parameters(
);
display_line!(
context.io(),
"{:4}Max. validator slots: {}",
"{:4}Liveness window: {} blocks",
"",
pos_params.max_validator_slots
pos_params.liveness_window_check
);
display_line!(
context.io(),
"{:4}Pipeline length: {}",
"{:4}Liveness threshold: {}",
"",
pos_params.pipeline_len
pos_params.liveness_threshold
);
display_line!(
context.io(),
"{:4}Unbonding length: {}",
"{:4}Block proposer reward: {}",
"",
pos_params.unbonding_len
pos_params.block_proposer_reward
);
display_line!(
context.io(),
"{:4}Block vote reward: {}",
"",
pos_params.block_vote_reward
);
display_line!(
context.io(),
"{:4}Max inflation rate: {}",
"",
pos_params.max_inflation_rate
);
display_line!(
context.io(),
"{:4}Target staked ratio: {}",
"",
pos_params.target_staked_ratio
);
display_line!(
context.io(),
"{:4}Inflation kP gain: {}",
"",
pos_params.rewards_gain_p
);
display_line!(
context.io(),
"{:4}Inflation kD gain: {}",
"",
pos_params.rewards_gain_d
);
display_line!(
context.io(),
"{:4}Votes per token: {}",
"{:4}Votes per raw token: {}",
"",
pos_params.tm_votes_per_token
);
Expand Down

0 comments on commit 7be5724

Please sign in to comment.