conformance: a conformance suite for the AIP-23 proof kinds (one verdict form over the published verifiers, 35 rules derived from code, 122 vectors, a runner for any implementation, a second verifier in Python); four defects it found in the published verifiers are fixed here: the market judge accepted a timeline with its submission event withheld, and three verifiers threw on malformed input instead of refusing by name
This commit is contained in:
1 parent
2c000478dc
commit
c9f2932e04
145 files changed
+17395
-104
No files matched your search
@@ -81,6 +81,9 @@ export async function fixturi(B, { dir, server }) {
|
||||
const q = { v: 1, kind: B.KIND_RASPUNS, name: 'nesortat', version: 1, commitmentHash: B.hashAngajament(c), field: 'k', from: 'a', to: 'b', indexSize: 2, rows: [rand(0), rand(1)], before: null, after: null };
|
||||
const x = B.verificaRaspuns(q, c); return { verdict: x.verdict, detail: x.motive.join('; ') }; } });
|
||||
F.push({ nume: 'N9 a record whose log proof points at another position', asteptat: 'INVALID', r: () => { const d = B.dovadaInregistrare(db, 2, 5); d.i = 6; d.logProof.index = 6; const x = B.verificaInregistrare(d, c2); return { verdict: x.ok ? 'VALID' : 'INVALID', detail: x.motive.join('; ') }; } });
|
||||
F.push({ nume: 'N10 malformed answers (a row without the queried field, a null row, a neighbour without a value, rows not a list) are refused by name, never thrown', asteptat: 'INVALID', r: () => {
|
||||
const rez = [(q) => { delete q.rows[1].disclosed.varsta; }, (q) => { q.rows[1] = null; }, (q) => { q.rows[0] = null; }, (q) => { delete q.before.value; }, (q) => { q.rows = 'x'; }].map((f) => { const q = B.interogheaza(db, 2, { field: 'varsta', from: 30, to: 40 }); f(q); const x = B.verificaRaspuns(q, c2); return x.verdict + ':' + x.reguli.length; });
|
||||
return { verdict: rez.every((x) => /^INVALID:[1-9]/.test(x)) ? 'INVALID' : 'VALID', detail: rez.join(' ') }; } });
|
||||
// availability sampling against the local server
|
||||
const ia = async (u) => { const r = await fetch(u, { signal: AbortSignal.timeout(10000) }); if (!r.ok) return null; return r.json(); };
|
||||
F.push({ nume: 'A1 availability sampling, 32 records drawn from a seed, all served and verified', asteptat: 'VALID', r: async () => { const x = await B.esantioneaza({ url: server.url, commitment: c2, k: 32, seed: 'proba-a1', ia }); return { verdict: x.ok ? 'VALID' : 'INVALID', detail: `${x.verificate}/${x.cerute}; ${x.motive.join('; ')}` }; } });
|
||||
|
||||
Reference in new issue
Block a user