Added IsValidNonnegative to coins module

This commit is contained in:
rigelrozanski 2017-09-19 20:16:04 -04:00
parent 0307321051
commit 3703121f09
1 changed files with 5 additions and 0 deletions

View File

@ -127,6 +127,11 @@ func (coins Coins) IsValid() bool {
} }
} }
// IsValidNonnegative tests is coins IsValid and IsNonnegative
func (coins Coins) IsValidNonnegative() bool {
return coins.IsValid() && coins.IsNonnegative()
}
// Plus combines to sets of coins // Plus combines to sets of coins
// //
// TODO: handle empty coins! // TODO: handle empty coins!