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
denomination validation is not done for Coin unless you use its constructor
Problem Definition
validateDenom is only called on Coin when using NewCoin or ParseCoin. A module that uses only Coin and not Coins can't appropriately validate the denomination without redundant code. A user could create a Coin without the constructor to bypass validation.
Proposal
Add an IsValid function to Coin that calls validateDenom as well as checking that the coin is > 0.
For Admin Use
Not duplicate issue
Appropriate labels applied
Appropriate contributors tagged
Contributor assigned/self-assigned
The text was updated successfully, but these errors were encountered:
Summary
denomination validation is not done for
Coin
unless you use its constructorProblem Definition
validateDenom
is only called onCoin
when usingNewCoin
orParseCoin
. A module that uses onlyCoin
and notCoins
can't appropriately validate the denomination without redundant code. A user could create aCoin
without the constructor to bypass validation.Proposal
Add an
IsValid
function toCoin
that callsvalidateDenom
as well as checking that the coin is > 0.For Admin Use
The text was updated successfully, but these errors were encountered: