NewBalanceTracker creates a new BalanceTracker instance. It initializes the Balances and Frequencies maps. Returns: - *model.BalanceTracker: A pointer to the newly created BalanceTracker instance.
()
| 45 | // Returns: |
| 46 | // - *model.BalanceTracker: A pointer to the newly created BalanceTracker instance. |
| 47 | func NewBalanceTracker() *model.BalanceTracker { |
| 48 | return &model.BalanceTracker{ |
| 49 | Balances: make(map[string]*model.Balance), |
| 50 | Frequencies: make(map[string]int), |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | // checkBalanceMonitors checks the balance monitors for a given updated balance. |
| 55 | // It starts a tracing span, fetches the monitors, and checks each monitor's condition. |