tests
This commit is contained in:
parent
37803d178d
commit
e95c1426d3
@ -44,13 +44,13 @@ describe('Protocol', function() {
|
||||
|
||||
var peers = [
|
||||
{
|
||||
ipv6: '0000:0000:0000:0000:0000:0000:0000:ffff',
|
||||
ipv6: '0000:0000:0000:0000:0000:ffff:0000:0000',
|
||||
ipv4: '127.0.0.1',
|
||||
port: 8333,
|
||||
ts: Date.now() / 1000 | 0
|
||||
},
|
||||
{
|
||||
ipv6: '0000:0000:0000:0000:0000:7f00:0001:ffff',
|
||||
ipv6: '0000:0000:0000:0000:0000:ffff:7f00:0001',
|
||||
ipv4: '10.0.0.1',
|
||||
port: 18333,
|
||||
ts: Date.now() / 1000 | 0
|
||||
@ -65,7 +65,6 @@ describe('Protocol', function() {
|
||||
});
|
||||
addr._ipv6 = addr.ipv6;
|
||||
addr.ipv6 = utils.toArray(addr.ipv6, 'hex');
|
||||
addr._ipv6 = '::' + addr._ipv6.split(':').slice(2).join(':');
|
||||
});
|
||||
|
||||
packetTest('addr', peers, function(payload) {
|
||||
@ -73,7 +72,7 @@ describe('Protocol', function() {
|
||||
assert.equal(payload.length, 2);
|
||||
|
||||
assert.equal(typeof payload[0].ts, 'number');
|
||||
assert.equal(payload[0].service, 1);
|
||||
assert.equal(payload[0].services, 1);
|
||||
assert.equal(payload[0].ipv6, peers[0]._ipv6);
|
||||
assert.equal(payload[0].ipv4, peers[0]._ipv4);
|
||||
assert.equal(payload[0].port, peers[0].port);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user