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

Method addDebit

model/model.go:108–115  ·  view source on GitHub ↗

addDebit adds the specified amount to the debit balances (either inflight or regular). inflight indicates whether the debit is inflight or not.

(amountBigInt *big.Int, inflight bool)

Source from the content-addressed store, hash-verified

106// addDebit adds the specified amount to the debit balances (either inflight or regular).
107// inflight indicates whether the debit is inflight or not.
108func (balance *Balance) addDebit(amountBigInt *big.Int, inflight bool) {
109 balance.InitializeBalanceFields()
110 if inflight {
111 balance.InflightDebitBalance.Add(balance.InflightDebitBalance, amountBigInt)
112 } else {
113 balance.DebitBalance.Add(balance.DebitBalance, amountBigInt)
114 }
115}
116
117// computeBalance computes the overall balance for inflight and normal balances.
118// inflight indicates whether the inflight balance or regular balance should be computed.

Callers 2

TestBalance_AddDebitFunction · 0.95
UpdateBalancesFunction · 0.80

Calls 1

Tested by 1

TestBalance_AddDebitFunction · 0.76