Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client-sdk: Add PrettyPrint to StakeThresholds #2066

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matevz
Copy link
Member

@matevz matevz commented Nov 18, 2024

This PR implements PrettyPrint() for StakeThresholds. Improves output of oasisprotocol/cli#318 to

$ oasis paratime show parameters --network testnet
Network:        testnet
ParaTime:       sapphire

=== ROFL_STAKETHRESHOLDS PARAMETERS ===
  App create: 10000.0 TEST

Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for oasisprotocol-oasis-sdk canceled.

Name Link
🔨 Latest commit 4565a33
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-oasis-sdk/deploys/673b5f989d6bc000089d49d8

@kostko
Copy link
Member

kostko commented Nov 18, 2024

=== ROFL_STAKETHRESHOLDS PARAMETERS ===

This looks ugly, why is it not rofl.StakeThresholds PARAMETERS or similar?

@matevz matevz force-pushed the matevz/feature/stake-thresholds-prettyprint branch from 26cb546 to 4565a33 Compare November 18, 2024 15:39
@matevz
Copy link
Member Author

matevz commented Nov 18, 2024

=== ROFL_STAKETHRESHOLDS PARAMETERS ===

This looks ugly, why is it not rofl.StakeThresholds PARAMETERS or similar?

The idea was to resemble oasis net show parameters output, e.g.

=== SCHEDULER PARAMETERS ===
  min_validators: 3
  max_validators: 110
  max_validators_per_entity: 1
  reward_factor_epoch_election_any: 0

=== BEACON PARAMETERS ===
  backend: vrf
  vrf_parameters:
    alpha_hq_threshold: 3
    interval: 600
    proof_delay: 300
    gas_costs:
      vrf_prove: 1000

=== GOVERNANCE PARAMETERS ===
  gas_costs:
    cast_vote: 1000
    submit_proposal: 1000
  min_proposal_deposit: 10000000000000
  voting_period: 12
  stake_threshold: 68
  upgrade_min_epoch_diff: 24
  upgrade_cancel_min_epoch_diff: 15
  enable_change_parameters_proposal: true
  allow_vote_without_entity: true
  allow_proposal_metadata: true

But I agree, it's not readable. This should look better:

=== ROFL PARAMETERS ===
  Stake thresholds:
    App create: 10000.0 TEST
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants