-
Notifications
You must be signed in to change notification settings - Fork 642
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
feature: Structured parameters config #8384
Conversation
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.
Looks good! Almost ready to merge. Just a few nits and discussion points I left in comments.
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.
Looking good! Please change as_string
to as_str
as commented, otherwise this should be ready to merge.
a809190
to
7354721
Compare
This is a part of near#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
This is a part of #8264.
This PR introduces structured values for Rationals in the parameter config in the form
To support this in the code, we now interpret parameter values as one of
In the future the plan is to extend this to support Fee structure and Weighted parameters.
One open Rust-related question here:
get_number
,get_string
,get_rational
methods?Things to finish: