MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / combineDistributions

Function combineDistributions

model/transaction.go:272–281  ·  view source on GitHub ↗

combineDistributions merges fixed and percentage amounts into the result

(state *distributionState)

Source from the content-addressed store, hash-verified

270
271// combineDistributions merges fixed and percentage amounts into the result
272func combineDistributions(state *distributionState) {
273 for id, amountDec := range state.fixedAmounts {
274 state.result[id] = amountDec.BigInt()
275 }
276
277 for id, amountDec := range state.percentAmounts {
278 state.result[id] = amountDec.BigInt()
279 state.amountLeftDec = state.amountLeftDec.Sub(amountDec)
280 }
281}
282
283// processLeftDistribution handles the "left" distribution type
284func processLeftDistribution(distributions []Distribution, state *distributionState) error {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected