// Broken fee gates, the way the SEAT5 review describes them, each broken one way. Used by scripts/broken.mjs only.
import { createHarness as real } from '../../src/harness.ts';
import { checkPayment, usedFees } from '../../src/kog-fee.ts';
export function make(kind: string) {
return (opts: any = {}) => {
switch (kind) {
case 'no-gate': return real({ ...opts, gated: [] });
case 'offers-ungated': return real({ ...opts, gated: ['bids'] });
case 'bids-ungated': return real({ ...opts, gated: ['offers'] });
case 'amount-unchecked': return real({ ...opts, verify: (a: any) => checkPayment({ ...a, payment: { ...a.payment, amount: a.quote.amount } }) });
case 'used-not-remembered': { const u = usedFees(); return real({ ...opts, used: { has: () => false, claim: () => true, release: (s: string) => u.release(s) } }); }
default: throw new Error(kind);
}
};
}
agentgate-source: code mirror on Cloudflare Pages. All repos