git ssb

0+

Dominic / ssb-validate



Commit d525d85855e0a0c8fe377418f26139e6d014b09b

test counts

Dominic Tarr committed on 7/27/2017, 8:37:37 AM
Parent: 51bc8f6b41ef93f18917bc07054c74c30412ad28

Files changed

test/generate.jschanged
test/generate.jsView
@@ -34,8 +34,11 @@
3434
3535 t.equal(state.feeds[keys.id].id, v.id(msg))
3636 t.equal(state.queue.length, 1)
3737
38 + t.equal(state.validated, 1)
39 + t.equal(state.queued, 0)
40 +
3841 //queue appends to a feed, but does not write check the signature
3942 //(because that is quite slow on javascript crypto)
4043
4144 var msg2 = v.create(keys, null, fstate, {type: 'test2'}, +new Date('2017-04-11 8:09 UTC'))
@@ -62,24 +65,31 @@
6265
6366
6467 tape('queue the first item', function (t) {
6568 var msg = v.create(keys2, null, null, {type: 'test'}, +new Date('2017-04-11 9:09 UTC'))
69 + t.equal(state.queued, 0)
70 + t.equal(state.validated, 3)
71 +
6672 state = v.queue(state, msg)
6773 var fstate = state.feeds[keys2.id]
6874 t.equal(fstate.id, null)
6975 t.equal(fstate.timestamp, null)
7076 t.equal(fstate.sequence, null)
7177 t.deepEqual(fstate.queue, [msg])
7278
79 + t.equal(state.queued, 1)
80 +
7381 var msg2 = v.create(keys2, null, fstate, {type: 'test'}, +new Date('2017-04-11 9:10 UTC'))
7482 state = v.queue(state, msg2)
83 + t.equal(state.queued, 2)
7584 t.notOk(state.error)
7685
86 + t.equal(state.validated, 3)
7787 state = v.validate(state, keys2.id)
7888
89 + t.equal(state.validated, 5)
90 + t.equal(state.queued, 0)
91 +
7992 t.end()
8093 })
8194
8295
83-
84-
85-

Built with git-ssb-web