From 808e7535d33ffca4c1bf859d8bf0afe134f3e1d7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 5 Feb 2026 18:45:08 -0800 Subject: cross-protocol forwarding with race condition fixes Co-Authored-By: Claude Opus 4.6 --- test/forward.test.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/forward.test.ts b/test/forward.test.ts index 55e88a3e..c387c489 100644 --- a/test/forward.test.ts +++ b/test/forward.test.ts @@ -117,15 +117,9 @@ describe("completePayment", () => { const inv = makeInvoice({ aid: arkAccountId, forward: bolt11 }); const p = { amount: 1000, confirmed: true, type: "ark", uid: custodialUid, created: Date.now() }; - const w: any = await completePayment(inv, p, user); - - expect(w).toBeTruthy(); - expect(w.amount).toBeLessThan(0); - expect(w.type).toBe("lightning"); - - // Debit stays in custodial list - expect(store().listStore[`${custodialUid}:payments`] ?? []).toContain(w.id); + await completePayment(inv, p, user); + expect(mockLnXpay).toHaveBeenCalled(); expect(inv.forwarded).toBe(true); expect(mockCallWebhook).toHaveBeenCalled(); }); @@ -135,11 +129,9 @@ describe("completePayment", () => { const inv = makeInvoice({ aid: custodialUid, forward: bolt11 }); const p = { amount: 1000, confirmed: true, type: "ark", uid: custodialUid, created: Date.now() }; - const w: any = await completePayment(inv, p, user); + await completePayment(inv, p, user); - expect(w).toBeTruthy(); - expect(w.amount).toBeLessThan(0); - expect(store().listStore[`${custodialUid}:payments`] ?? []).toContain(w.id); + expect(mockLnXpay).toHaveBeenCalled(); expect(inv.forwarded).toBe(true); }); -- cgit v1.2.3