Comparing version 2.1.1 to 2.1.2
@@ -5,13 +5,7 @@ const pull = require('pull-stream') | ||
module.exports = function tangleTips (server, spec, id, cb) { | ||
const attachTransformation = m => { | ||
m.T = spec.getTransformation(m) | ||
return m | ||
// NOTE we pass the whole message along because isValidNextStep is guarenteed the msg | ||
} | ||
server.get({ id, private: true, meta: true }, (err, root) => { | ||
if (err) return cb(err) | ||
const rootNode = attachTransformation(root) | ||
if (!spec.isRoot(rootNode.T)) return cb(new Error(`not a valid ${spec.type}, ${spec.isRoot.errorsString}`)) | ||
const rootNodeT = spec.getTransformation(root, 0) | ||
if (!spec.isRoot(rootNodeT)) return cb(new Error(`not a valid ${spec.type}, ${spec.isRoot.errorsString}`)) | ||
@@ -44,11 +38,10 @@ if (isEmpty(root.value.content.authors)) { | ||
server.backlinks.read({ query }), | ||
pull.map(attachTransformation), | ||
pull.filter(m => spec.isUpdate(m.T)), | ||
pull.collect((err, updateNodes) => { | ||
pull.filter(m => spec.isUpdate(spec.getTransformation(m, 0))), // here we fake the distance = 0 just for this test | ||
pull.collect((err, updates) => { | ||
if (err) return cb(err) | ||
const msgs = [rootNode, ...updateNodes] | ||
const msgs = [root, ...updates] | ||
const reduce = new Reduce(spec.props, { | ||
nodes: msgs, | ||
getTransformation: m => m.T, | ||
getTransformation: spec.getTransformation, | ||
getBacklinks: m => m.value.content.tangles[spec.tangle].previous, | ||
@@ -55,0 +48,0 @@ isValid: spec.isValidNextStep |
{ | ||
"name": "ssb-crut", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "easy CRUT methods for secure scuttlebutt", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,3 +28,3 @@ const overwrite = require('@tangle/overwrite')() | ||
(content) => true | ||
], | ||
] | ||
// isUpdate: [] | ||
@@ -31,0 +31,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51419
1418