Updates
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user