mirror of https://github.com/BTCPrivate/copay.git
fix test after rebase
This commit is contained in:
parent
0f67d3e6bd
commit
0d22524885
|
@ -6,7 +6,6 @@ function Network(opts) {}
|
||||||
util.inherits(Network, EventEmitter);
|
util.inherits(Network, EventEmitter);
|
||||||
|
|
||||||
Network.prototype.start = function(opts, cb) {
|
Network.prototype.start = function(opts, cb) {
|
||||||
// start! :D
|
|
||||||
this.peer = {
|
this.peer = {
|
||||||
options: {
|
options: {
|
||||||
token: "asd"
|
token: "asd"
|
||||||
|
@ -15,18 +14,12 @@ Network.prototype.start = function(opts, cb) {
|
||||||
if (cb) cb();
|
if (cb) cb();
|
||||||
};
|
};
|
||||||
|
|
||||||
Network.prototype.send = function(peerIds, data, cb) {
|
Network.prototype.send = function(peerIds, data, cb) {};
|
||||||
// send! c:
|
|
||||||
};
|
|
||||||
|
|
||||||
Network.prototype.connectTo = function(peerId) {
|
Network.prototype.connectTo = function(peerId) {};
|
||||||
// connect C:
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Network.prototype.disconnect = function(cb) {
|
Network.prototype.disconnect = function(cb) {};
|
||||||
// disconect :c
|
|
||||||
};
|
|
||||||
|
|
||||||
Network.prototype.lockIncommingConnections = function() {
|
Network.prototype.lockIncommingConnections = function() {
|
||||||
|
|
||||||
|
@ -43,7 +36,7 @@ Network.prototype.peerFromCopayer = function(copayerId) {
|
||||||
|
|
||||||
//hex version of one's own nonce
|
//hex version of one's own nonce
|
||||||
Network.prototype.setHexNonce = function(networkNonce) {
|
Network.prototype.setHexNonce = function(networkNonce) {
|
||||||
if (networkNonce && networkNonce.length === 16)
|
if (networkNonce && networkNonce.length === 16)
|
||||||
this.networkNonce = new Buffer(networkNonce, 'hex');
|
this.networkNonce = new Buffer(networkNonce, 'hex');
|
||||||
else
|
else
|
||||||
this.iterateNonce();
|
this.iterateNonce();
|
||||||
|
@ -84,7 +77,7 @@ Network.prototype.iterateNonce = function() {
|
||||||
//the second 4 bytes is just an iterated "sub" nonce
|
//the second 4 bytes is just an iterated "sub" nonce
|
||||||
//the whole thing is interpreted as one big endian number
|
//the whole thing is interpreted as one big endian number
|
||||||
var noncep1 = this.networkNonce.slice(0, 4);
|
var noncep1 = this.networkNonce.slice(0, 4);
|
||||||
noncep1.writeUInt32BE(Math.floor(Date.now()/1000), 0);
|
noncep1.writeUInt32BE(Math.floor(Date.now() / 1000), 0);
|
||||||
var noncep2uint = this.networkNonce.slice(4, 8).readUInt32BE(0);
|
var noncep2uint = this.networkNonce.slice(4, 8).readUInt32BE(0);
|
||||||
var noncep2 = this.networkNonce.slice(4, 8);
|
var noncep2 = this.networkNonce.slice(4, 8);
|
||||||
noncep2.writeUInt32BE(noncep2uint + 1, 0);
|
noncep2.writeUInt32BE(noncep2uint + 1, 0);
|
||||||
|
@ -92,4 +85,9 @@ Network.prototype.iterateNonce = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Network.prototype.cleanUp = function() {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
module.exports = Network;
|
module.exports = Network;
|
||||||
|
|
Loading…
Reference in New Issue