git ssb

0+

Dominic / ssb-validate



Commit 0cec2551153f5d8ab4fe1fbe163808e732b5e208

oop, actually implement validate

Dominic Tarr committed on 7/18/2017, 11:27:21 AM
Parent: 905cf9a890983a1382452a02d3469110d6d0fa59

Files changed

index.jschanged
index.jsView
@@ -94,11 +94,13 @@
9494 return state
9595 }
9696
9797 exports.validate = function (state, feed) {
98- if(!state.feeds[feed] || !state.feeds[feed].queue.length)
98 + if(!state.feeds[feed] || !state.feeds[feed].queue.length) {
9999 return state
100-
100 + }
101 + var msg = state.feeds[feed].queue.pop()
102 + return exports.append(state, msg)
101103 }
102104
103105 //pass in your own timestamp, so it's completely deterministic
104106 exports.create = function (keys, hmac_key, state, content, timestamp) {
@@ -118,4 +120,6 @@
118120 return '%'+ssbKeys.hash(JSON.stringify(msg, null, 2))
119121 }
120122
121123
124 +
125 +

Built with git-ssb-web