Files
bitvid/tests
thePR0M3TH3ANandClaude Opus 4.8 0ec9db70e8 fix(zap): receipt validation works with nostr-tools 2.x SimplePool
After a successful split zap, validation errored: "Unable to initialize a relay
pool for receipt validation." The validator built a fresh `new SimplePool()` and
required `pool.list()`, but nostr-tools 2.x removed SimplePool.list() (the rest of
the app only has it because js/nostr/toolkit.js shims it). So validation always
failed even though the payment went through.

Fix: resolveReceiptListPool() applies the app's legacy .list shim
(shimLegacySimplePoolMethods) to the freshly created pool, and the gate now
accepts a listEvents override instead of hard-requiring pool.list.

tests/zap-receipt-pool.test.mjs: 2.x pool gets .list shimmed; createPool override
shimmed; listEvents override leaves the pool as-is; null when neither available.
Mutation-verified (removing the shim fails it).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-21 22:11:46 -04:00
..
2026-02-21 16:08:33 -05:00
2026-02-21 15:53:09 -05:00