-
Notifications
You must be signed in to change notification settings - Fork 378
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
Governance Proposal View Decoding should indicate scientific notation of values #5343
Comments
On related note (which may merit a dedicated issue): Some parameters have magical correction factors between the natural representation and the one used by contracts (and thus showing in proposals). This makes it error-prone to verify proposals. For example, consider the way fixed-point fractions are represented by FixidityLib:
To understand what reward fraction this really sets, one would have to open up the code of FixidityLib and figure out how it represents fixed-point fractions as integers. Similarly with the reserve fraction of CGP 0007 and CGP 0008. The CGP mentions the correction factor ( Same problem with the 10^-18 factor for CELO amounts as in CGP 0006. Now you may say, people are already used to dividing by 10^18 whenever they see a huge number representing CELO amounts. But that's not good enough, and in fact is dangerous: if the number does look natural, people may forget that it should be divided by 10^18 anyway. And also, conversely: if for whatever reason some contract accepts CELO amounts as integers instead of fractions, and a proposal sends it 10^19 in a parameter, reviewers will think that means 10 CELO. I'm not sure how to resolve all of these, and they also affect the usability of |
That is absolutely a great point! I'm not sure how easy it will be to automatically parse that a value is indeed a fixidity value, but whoever works on this should consider looking into it! |
related ethers-io/ethers.js#228 |
…and CLI (#5584) ### Description - Modifies cli utility `printValueMapRecursive` to display scientific notation when significant digits > 3 up to 3 decimal points - Makes `network:parameters` use `kit.getHumanReadableNetworkConfig` by default and `kit.getNetworkConfig` with `--raw` flag provided ### Other changes - Adds `blocksToDurationString`, `secondsToDurationString`, `unixSecondsTimestampToDateString` utilities to contractkit's `BaseWrapper` for use in `getHumanReadableConfig` of various wrappers ### Tested `celocli network:parameters --node https://baklava-forno.celo-testnet.org`  ### Related issues - Fixes #5343 ### Backwards compatibility Machine consumers of `network:parameters` must now pass `--raw`
Expected Behavior
The values should should display scientific notation when above 1 Million
Current Behavior
The values are displayed in full
The text was updated successfully, but these errors were encountered: