This commit is contained in:
Raven Scott
2026-05-20 21:02:45 -04:00
parent 1f3f4b24a2
commit 14d0980b4f
734 changed files with 682 additions and 746 deletions
@@ -0,0 +1,27 @@
require('bare-process/global')
const test = require('brittle')
const { HyperP2PParadoxClock } = require('../index.js')
test('paradox-clock: stamp and resolve', async (t) => {
const c = new HyperP2PParadoxClock()
const a = c.stamp('e1', { skew: 100000 })
const b = c.stamp('e2', { skew: -50000 })
const w = c.resolve(a, b)
t.ok(w.logical >= 1)
await c.close()
})
test('paradox-clock: merge', async (t) => {
const a = new HyperP2PParadoxClock()
const b = new HyperP2PParadoxClock()
a.stamp('evt')
b.merge(a.toJSON())
t.ok(b.getStamp('evt'))
await a.close()
await b.close()
})
test('hyper-p2p-paradox-clock: close without leak', async (t) => {
const m = new HyperP2PParadoxClock()
await m.close()
t.pass()
})