Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
test(forge-high-payment): assert a malformed payment_id never reaches the uuid lookup
nirholasf4270f9107ce
diff --git a/tests/forge-high-payment.test.js b/tests/forge-high-payment.test.jsindex c76049699..1cbdba73f 100644--- a/tests/forge-high-payment.test.js+++ b/tests/forge-high-payment.test.js@@ -89,6 +89,19 @@ describe('assertForgePayment', () => {});});+ // Regression: a malformed payment_id used to reach the `where id = $1` lookup+ // against a uuid column, so Postgres raised 22P02 and the driver error escaped+ // this module carrying the SQLSTATE as `code` and the raw cast message as+ // `message`, both of which the High gate in api/forge.js echoes straight to+ // the caller. It must be a plain payment_invalid, decided before any query.+ it('rejects a malformed payment_id as payment_invalid without querying the database', async () => {+ await expect(assertForgePayment({ paymentId: 'deadbeef', refId: REF_ID })).rejects.toMatchObject({+ status: 402,+ code: 'payment_invalid',+ });+ expect(sql).not.toHaveBeenCalled();+ });+it('rejects a non-consumption / non-forge payment (a different action) ', async () => {queueAssert({ payment: paymentRow({ purpose: 'spin' }) });await expect(assertForgePayment({ paymentId: PAY_ID, refId: REF_ID })).rejects.toMatchObject({