Open 0x009922 opened 8 months ago
as discussed https://github.com/hyperledger/iroha-2-docs/issues/392 I'm not sure we want to complicate config files. Simple fixed suffix on the field name should suffice IMO. We need to discuss this before proceeding
I am in favor of having human-readable suffixes in config, this makes it much easier to write large values by hand.
Oftentimes, when a large value is needed, you would still end up having a comment to explain what the value actually is, like max_transfer_bytes = 1048576 # 1 MiB
, so having this natively supported by the config system is better UX IMO.
Same opinion on the #4294 with the same arguments, time_value = "1h"
is better than time_value_ms = 3600000 # 1 hour
Description
Actually implement parsing from a human-readable string for
HumanBytes
:https://github.com/hyperledger/iroha/blob/964476722e2a219becaacdb3676ca058ec5748cd/config/base/src/lib.rs#L36-L38
Specification
Here is an excerpt from the config reference draft:
I used
humanfriendly
Python package as a reference.Also
4294