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

Function parseBigInt

database/balance.go:50–56  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
50func 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.

Callers 15

scanRowFunction · 0.85
GetBalanceByIDLiteMethod · 0.85
GetBalancesByIDsLiteMethod · 0.85
GetBalanceByIndicatorMethod · 0.85
GetAllBalancesMethod · 0.85
getMostRecentSnapshotMethod · 0.85
GetTransactionMethod · 0.85
GetTransactionByRefMethod · 0.85
GroupTransactionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected