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
NewCoin and NewDecCoin functions should panic if the supplied denomination is empty in order to reduce surface of vulnerabilities that could potentially be introduced by lack of preemptive validation (e.g. by not calling IsValid())
On the other hand, ParseCoin functions should check for empty denoms and appropriately handle empty denoms zero-coin cases as per argument supplied by the caller. ParseCoin functions might take an additional parameter strict for instance to either return a ZeroCoin() or fail in zero-coin cases.
Alternatively, we may want to provide an alternative implementation for each case, e.g. ParsePositiveCoins, ParseNonNegativeCoins - either ways the client would not be required to call IsZero or IsPositive on the return value.
NewCoin
andNewDecCoin
functions should panic if the supplied denomination is empty in order to reduce surface of vulnerabilities that could potentially be introduced by lack of preemptive validation (e.g. by not callingIsValid()
)On the other hand,
ParseCoin
functions should check for empty denoms and appropriately handle empty denoms zero-coin cases as per argument supplied by the caller.ParseCoin
functions might take an additional parameterstrict
for instance to either return a ZeroCoin() or fail in zero-coin cases.Alternatively, we may want to provide an alternative implementation for each case, e.g.
ParsePositiveCoins
,ParseNonNegativeCoins
- either ways the client would not be required to callIsZero
orIsPositive
on the return value./cc @alexanderbez @cwgoes @sunnya97 @jackzampolin
For Admin Use
The text was updated successfully, but these errors were encountered: