[Testkit] Bootstrap route + refund ledger coverage (T23–T24) #54
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & Why
POST /api/bootstrapis the highest-value paid feature (10 000 sats default fee) yet has zero testkit coverage. The refund payout path happy-path is also untested. This adds T23 and T24.Done looks like
POST /api/bootstrap→ 201 withpaymentHash,stubMode: true; stub-pay the invoice; poll untilstate === "provisioning"orstate === "ready"; verify response hasbootstrapJobId,state,messagecostLedgerfromGET /api/jobs/:id; verifyactualInputTokens,actualOutputTokens,actualCostUsd,actualAmountSats,refundAmountSats,refundStateare all present and internally consistent (actualAmountSats <= workAmountSats,refundAmountSats >= 0)GET /api/testkitexecution and appear in summary blockTasks
artifacts/api-server/src/routes/testkit.ts, append T23 before the Summary block. Create bootstrap job viaPOST /api/bootstrap, stub-pay the invoice, pollGET /api/bootstrap/:iduntil non-awaiting_paymentstate.GET /api/jobs/:id, assert all cost ledger fields are present and self-consistent.Relevant files
artifacts/api-server/src/routes/testkit.tsartifacts/api-server/src/routes/bootstrap.tsartifacts/api-server/src/routes/jobs.ts