This commit is contained in:
Raven Scott
2026-05-21 02:00:00 -04:00
parent 8971182b3f
commit 3b75e74dbd
107 changed files with 1060 additions and 211 deletions
@@ -29,12 +29,23 @@ test('validation', async (t) => {
await m.close()
})
test('headEntry findByType chainLength', async (t) => {
const m = new HyperP2PCoreAuditChain()
m.appendAudit({ type: 'a', n: 1 })
m.appendAudit({ type: 'b', n: 2 })
t.is(m.chainLength(), 2)
t.is(m.headEntry().type, 'b')
t.is(m.findByType('a').length, 1)
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PCoreAuditChain()
m.appendAudit({ x: 1 })
const s = m.getStats()
t.is(s.protocol, 'core-audit-chain/v1')
t.is(s.length, 1)
t.is(s.mode, 'hypercore')
await m.close()
})