validateDistributions checks that total distributions don't exceed limits
(state *distributionState)
| 223 | |
| 224 | // validateDistributions checks that total distributions don't exceed limits |
| 225 | func validateDistributions(state *distributionState) error { |
| 226 | hundredDec := decimal.NewFromInt(100) |
| 227 | if state.totalPercentage.Cmp(hundredDec) > 0 || state.fixedTotalDec.Cmp(state.totalAmountDec) > 0 { |
| 228 | return errors.New("total distributions exceed 100% or total amount") |
| 229 | } |
| 230 | return nil |
| 231 | } |
| 232 | |
| 233 | // adjustPercentageAmounts adjusts percentage amounts to maintain the correct total |
| 234 | func adjustPercentageAmounts(state *distributionState) { |
no outgoing calls
no test coverage detected