aboutsummaryrefslogtreecommitdiffstats
path: root/src/sync-outbox.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-07 07:54:23 -0700
committerAdam Soltys <[email protected]>2026-09-07 07:54:23 -0700
commit779284629dd30df04b5e594b9d729546e08bbe71 (patch)
treee41a1086f96a6edcc0c6b4524af2984c3627612e /src/sync-outbox.js
parent037f025deba86713a470916964e9a388789f3b74 (diff)
downloadcoinosv3-779284629dd30df04b5e594b9d729546e08bbe71.tar.gz
coinosv3-779284629dd30df04b5e594b9d729546e08bbe71.zip
Fix "Cannot mix BigInt and other types" when creating an on-chain gift.
_buildGiftPsbt (the v2 ephemeral-key gift builder) subtracted the funding fee — _giftFundFee returns a Number — directly from BigInt coin sums (sum - _giftFundFee(...), sum - gift - _giftFundFee(...)), which throws in JS. Any on-chain (Savings) gift creation hit it: "Split a coin first", "Lock the whole coin", and gift-all. Wrap the fee in BigInt at those sites (new fundFee() helper). Adds tools/gift-build-test.js — the on-chain gift BUILDER had no coverage, which is how this shipped. It builds a specific-amount gift, a whole-balance gift, and the split carve-out shape (all three fee branches) against a mock wallet and asserts they produce claimable v2 codes without throwing. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01MGzU12QrAA4G6BYGzGVdXz
Diffstat (limited to 'src/sync-outbox.js')
0 files changed, 0 insertions, 0 deletions