parseBigInt parses a string into a *big.Int, returning an error if parsing fails. This ensures we don't silently get nil values when database returns malformed data.
(s string)
| 48 | // parseBigInt parses a string into a *big.Int, returning an error if parsing fails. |
| 49 | // This ensures we don't silently get nil values when database returns malformed data. |
| 50 | func parseBigInt(s string) (*big.Int, error) { |
| 51 | n, ok := new(big.Int).SetString(s, 10) |
| 52 | if !ok { |
| 53 | return nil, fmt.Errorf("invalid big.Int value: %q", s) |
| 54 | } |
| 55 | return n, nil |
| 56 | } |
| 57 | |
| 58 | // Prepares a dynamic SQL query based on the fields to be included. |
| 59 | // This query fetches balance details, including optional joins for identity and ledger. |
no outgoing calls
no test coverage detected