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
@@ -30,10 +30,21 @@ test('cancelBlock', async (t) => {
await m.close()
})
test('enqueueMany bumpPriority inflightCount', async (t) => {
const m = new HyperP2PCorePriorityFetch()
t.is(m.enqueueMany([1, 2, 3], 1), 3)
m.dequeue()
t.is(m.inflightCount(), 1)
m.bumpPriority(2, 99)
t.ok(m.peekBlock().index === 2 || m.peekBlock().index === 3)
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PCorePriorityFetch()
m.enqueueBlock(0, 0)
t.is(m.getStats().pending, 1)
t.is(m.getStats().mode, 'hypercore')
await m.close()
})