(balancesByID map[string]*model.Balance, txn *model.Transaction)
| 1485 | } |
| 1486 | |
| 1487 | func coalescingBalancesForTransaction(balancesByID map[string]*model.Balance, txn *model.Transaction) (*model.Balance, *model.Balance, error) { |
| 1488 | sourceBalance, ok := balancesByID[txn.Source] |
| 1489 | if !ok || sourceBalance == nil { |
| 1490 | return nil, nil, fmt.Errorf("missing source balance %s for coalesced transaction", txn.Source) |
| 1491 | } |
| 1492 | |
| 1493 | destinationBalance, ok := balancesByID[txn.Destination] |
| 1494 | if !ok || destinationBalance == nil { |
| 1495 | return nil, nil, fmt.Errorf("missing destination balance %s for coalesced transaction", txn.Destination) |
| 1496 | } |
| 1497 | |
| 1498 | return sourceBalance, destinationBalance, nil |
| 1499 | } |
| 1500 | |
| 1501 | func (l *LedgerForge) getQueuedBatchExistingReferences(ctx context.Context, transactions []*model.Transaction) (map[string]struct{}, map[string]struct{}, error) { |
| 1502 | references := make([]string, 0, len(transactions)) |
no outgoing calls
no test coverage detected