-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Structured parameters config (#8384)
This is a part of #8264. This PR introduces structured values for Rationals in the parameter config in the form ```yaml burnt_gas_reward: { numerator: 3, denominator: 10, } ``` To support this in the code, we now interpret parameter values as one of ```rust enum ParameterValue { Null, U64(u64), Rational { numerator: isize, denominator: isize }, String(String), } ``` In the future the plan is to extend this to support Fee structure and Weighted parameters. One open Rust-related question here: - [ ] What is a good way to deduplicate code between `get_number`, `get_string`, `get_rational` methods? Things to finish: - [x] Tests for the Rational type
- Loading branch information
Showing
4 changed files
with
264 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
core/primitives/res/runtime_configs/parameters_testnet.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.