fix test 16

This commit is contained in:
Manuel Araoz 2014-08-19 15:57:41 -04:00
parent 614d8d63ad
commit c905668195
1 changed files with 0 additions and 30 deletions

View File

@ -205,36 +205,6 @@ describe('Network / Async', function() {
n2._deletePeer.calledOnce.should.equal(true);
});
it('should reject data sent from a peer with a really big outdated nonce', function() {
var n = createN();
n.privkey = key2.private.toString('hex');
n.key = null;
n.networkNonces = {};
n.networkNonces[(new bitcore.SIN(key1.public)).toString()] = new Buffer('5000000000000002', 'hex'); //previously used nonce
var message = {
type: 'hello',
copayerId: key1.public.toString('hex')
};
var messagestr = JSON.stringify(message);
var messagebuf = new Buffer(messagestr);
var opts = {
nonce: new Buffer('5000000000000001', 'hex')
}; //message send with old nonce
var encoded = n._encode(key2.public, key1, messagebuf, opts);
var encodedstr = JSON.stringify(encoded);
var encodeduint = new Buffer(encodedstr);
var isInbound = true;
var peerId = new bitcore.SIN(key1.public);
n._deletePeer = sinon.spy();
n._onMessage(encodeduint, isInbound, peerId);
n._deletePeer.calledOnce.should.equal(true);
});
});
describe('#setHexNonce', function() {