Commit 0cec2551153f5d8ab4fe1fbe163808e732b5e208
oop, actually implement validate
Dominic Tarr committed on 7/18/2017, 11:27:21 AMParent: 905cf9a890983a1382452a02d3469110d6d0fa59
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -94,11 +94,13 @@ | ||
94 | 94 … | return state |
95 | 95 … | } |
96 | 96 … | |
97 | 97 … | 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) { | |
99 | 99 … | return state |
100 | - | |
100 … | + } | |
101 … | + var msg = state.feeds[feed].queue.pop() | |
102 … | + return exports.append(state, msg) | |
101 | 103 … | } |
102 | 104 … | |
103 | 105 … | //pass in your own timestamp, so it's completely deterministic |
104 | 106 … | exports.create = function (keys, hmac_key, state, content, timestamp) { |
@@ -118,4 +120,6 @@ | ||
118 | 120 … | return '%'+ssbKeys.hash(JSON.stringify(msg, null, 2)) |
119 | 121 … | } |
120 | 122 … | |
121 | 123 … | |
124 … | + | |
125 … | + |
Built with git-ssb-web