-
Notifications
You must be signed in to change notification settings - Fork 220
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
[uint] Better constant support #585
Comments
It's possible to create it like const THE_ANSWER: U256 = U256([42, 0, 0, 0]); however, I agree a convenient method would be good. |
Ahh, I haven't noticed the field is public. Nice. |
In CosmWasm/cosmwasm#1071 you find a const implementation of |
FYI gakonst/ethers-rs#2486 (comment) -- uint v0.9.3 has a few functions that could be const that aren't (e.g. |
Most ways to construct values seem not to be usable in constants except for
zero()
andMAX
. I wonder if it would be possible/desirable to have some way to construct these things in a const context, e.g. withfrom_big_endian()
? Or by directly providing[u64; N_WORDS]
?Maybe then this could be made more convenient with macros, e.g. a macro that converts an integer literal to
[u64; N_WORDS]
, usable in a const context.The text was updated successfully, but these errors were encountered: