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

Function handleZeroAmount

model/transaction.go:385–391  ·  view source on GitHub ↗

handleZeroAmount returns zero amounts for all distributions when total is zero

(distributions []Distribution)

Source from the content-addressed store, hash-verified

383
384// handleZeroAmount returns zero amounts for all distributions when total is zero
385func handleZeroAmount(distributions []Distribution) map[string]*big.Int {
386 result := make(map[string]*big.Int)
387 for _, dist := range distributions {
388 result[dist.Identifier] = big.NewInt(0)
389 }
390 return result
391}
392
393// handleSmallAmount assigns entire amount to first distribution for very small amounts
394func handleSmallAmount(totalAmountDec decimal.Decimal, totalPreciseAmount *big.Int, distributions []Distribution) map[string]*big.Int {

Callers 2

TestHandleZeroAmountFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestHandleZeroAmountFunction · 0.68