You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often you have fixed values that could already be parsed during compile time. Currently I am initializing those values using lazy_static. My proposal would be to have macros to parse ether, wei, etc. from a string to U256.
Currently you will write:
let val:U256 = parse_units("0.01","ether").unwrap().get_absolute();
Proposal:
let val:U256 = ether!("0.01");
If the parsing fails it will throw an error during compile time.
Additional context
No response
The text was updated successfully, but these errors were encountered:
In the future we will be able to make more and more of the primitives const fn as more standard library methods and traits do, which will include the utils functions.
For now, you can use the uint! macro or the crate linked above
Component
primitives
Describe the feature you would like
Often you have fixed values that could already be parsed during compile time. Currently I am initializing those values using lazy_static. My proposal would be to have macros to parse ether, wei, etc. from a string to U256.
Currently you will write:
Proposal:
If the parsing fails it will throw an error during compile time.
Additional context
No response
The text was updated successfully, but these errors were encountered: