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

Method addCredit

model/model.go:96–104  ·  view source on GitHub ↗

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

(amountBigInt *big.Int, inflight bool)

Source from the content-addressed store, hash-verified

94// addCredit adds the specified amount to the credit balances (either inflight or regular).
95// inflight indicates whether the credit is inflight or not.
96func (balance *Balance) addCredit(amountBigInt *big.Int, inflight bool) {
97 balance.InitializeBalanceFields() // Ensure balance fields are initialized.
98
99 if inflight {
100 balance.InflightCreditBalance.Add(balance.InflightCreditBalance, amountBigInt)
101 } else {
102 balance.CreditBalance.Add(balance.CreditBalance, amountBigInt)
103 }
104}
105
106// addDebit adds the specified amount to the debit balances (either inflight or regular).
107// inflight indicates whether the debit is inflight or not.

Callers 2

TestBalance_AddCreditFunction · 0.95
UpdateBalancesFunction · 0.80

Calls 1

Tested by 1

TestBalance_AddCreditFunction · 0.76