feat: productionize paid modes and PvP capture

This commit is contained in:
jwinterm
2026-07-21 20:41:27 -04:00
parent 8fb284f8ed
commit 89398335c7
230 changed files with 31755 additions and 2777 deletions
+22
View File
@@ -0,0 +1,22 @@
'use strict';
const fs = require('fs');
const path = require('path');
const deploy = name => fs.readFileSync(path.join(__dirname, '..', 'scripts', 'deploy', name), 'utf8');
describe('deployment financial-audit contract', () => {
const audit = deploy('financial-audit.sql');
test('retained consumed match anchors are not treated as live escrow', () => {
expect(audit).toMatch(/match_queue_entries\s+WHERE status IS NULL OR status NOT IN \('consumed', 'cancelled'\)/);
expect(audit).not.toMatch(/status NOT IN \('cancelled'\)/);
});
test('nullable or unknown money/game states and a stale schema ledger fail closed', () => {
expect(audit).toContain("payouts WHERE status IS DISTINCT FROM 'completed'");
expect(audit).toContain("games WHERE status IS NULL OR status NOT IN ('won', 'lost', 'expired')");
expect(audit).toContain("MAX(filename) = '040_paid_match_entropy_precommit.sql'");
expect(audit).toContain('COUNT(*) = 40');
});
});