hypercore-protocol
Advanced tools
Comparing version 6.4.2 to 6.5.0
@@ -19,2 +19,3 @@ var stream = require('readable-stream') | ||
this.live = !!opts.live | ||
this.ack = !!opts.ack | ||
this.userData = opts.userData || null | ||
@@ -145,3 +146,4 @@ this.remoteId = null | ||
userData: this.userData, | ||
extensions: this.extensions | ||
extensions: this.extensions, | ||
ack: this.ack | ||
}) | ||
@@ -268,2 +270,3 @@ } | ||
this.remoteExtensions = indexOf(this.extensions, handshake.extensions) | ||
this.remoteAck = handshake.ack | ||
@@ -270,0 +273,0 @@ this.emit('handshake') |
{ | ||
"name": "hypercore-protocol", | ||
"version": "6.4.2", | ||
"version": "6.5.0", | ||
"description": "Stream that implements the hypercore protocol", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,3 @@ var tape = require('tape') | ||
tape('basic with handshake options', function (t) { | ||
t.plan(12) | ||
t.plan(16) | ||
@@ -38,3 +38,3 @@ var data = [ | ||
var a = protocol({id: new Buffer('a'), live: true, userData: new Buffer(data)}) | ||
var b = protocol({id: new Buffer('b'), live: false}) | ||
var b = protocol({id: new Buffer('b'), live: false, ack: true}) | ||
@@ -47,2 +47,3 @@ a.feed(KEY) | ||
t.same(a.live, true) | ||
t.same(a.ack, false) | ||
t.same(a.userData, new Buffer(data)) | ||
@@ -52,2 +53,3 @@ t.same(a.remoteId, new Buffer('b')) | ||
t.same(a.remoteUserData, null) | ||
t.same(a.remoteAck, true) | ||
}) | ||
@@ -58,2 +60,3 @@ | ||
t.same(b.live, false) | ||
t.same(b.ack, true) | ||
t.same(b.userData, null) | ||
@@ -63,2 +66,3 @@ t.same(b.remoteId, new Buffer('a')) | ||
t.same(b.remoteUserData, new Buffer(data)) | ||
t.same(b.remoteAck, false) | ||
}) | ||
@@ -65,0 +69,0 @@ |
Sorry, the diff of this file is not supported yet
39013
1017