fix merge with master

This commit is contained in:
Manuel Araoz 2014-06-23 10:59:33 -03:00
commit 3ce3af4408

View file

@ -627,7 +627,9 @@ describe('Wallet model', function() {
it('#indexDiscovery should work without found activities', function(done) { it('#indexDiscovery should work without found activities', function(done) {
var w = createW2(); var w = createW2();
mockFakeActivity(w, function(index) { return false }); mockFakeActivity(w, function(index) {
return false
});
w.indexDiscovery(0, false, 5, function(e, lastActive) { w.indexDiscovery(0, false, 5, function(e, lastActive) {
lastActive.should.equal(-1); lastActive.should.equal(-1);
done(); done();
@ -636,7 +638,9 @@ describe('Wallet model', function() {
it('#indexDiscovery should continue scanning', function(done) { it('#indexDiscovery should continue scanning', function(done) {
var w = createW2(); var w = createW2();
mockFakeActivity(w, function(index) { return index <= 7 }); mockFakeActivity(w, function(index) {
return index <= 7
});
w.indexDiscovery(0, false, 5, function(e, lastActive) { w.indexDiscovery(0, false, 5, function(e, lastActive) {
lastActive.should.equal(7); lastActive.should.equal(7);
done(); done();
@ -645,7 +649,9 @@ describe('Wallet model', function() {
it('#indexDiscovery should not found beyond the scannWindow', function(done) { it('#indexDiscovery should not found beyond the scannWindow', function(done) {
var w = createW2(); var w = createW2();
mockFakeActivity(w, function(index) { return index <= 10 || index == 17 }); mockFakeActivity(w, function(index) {
return index <= 10 || index == 17
});
w.indexDiscovery(0, false, 5, function(e, lastActive) { w.indexDiscovery(0, false, 5, function(e, lastActive) {
lastActive.should.equal(10); lastActive.should.equal(10);
done(); done();
@ -654,7 +660,9 @@ describe('Wallet model', function() {
it('#indexDiscovery should look for activity along the scannWindow', function(done) { it('#indexDiscovery should look for activity along the scannWindow', function(done) {
var w = createW2(); var w = createW2();
mockFakeActivity(w, function(index) { return index <= 14 && index % 2 == 0 }); mockFakeActivity(w, function(index) {
return index <= 14 && index % 2 == 0
});
w.indexDiscovery(0, false, 5, function(e, lastActive) { w.indexDiscovery(0, false, 5, function(e, lastActive) {
lastActive.should.equal(14); lastActive.should.equal(14);
done(); done();
@ -663,7 +671,9 @@ describe('Wallet model', function() {
it('#updateIndexes should update correctly', function(done) { it('#updateIndexes should update correctly', function(done) {
var w = createW2(); var w = createW2();
mockFakeActivity(w, function(index) { return index <= 14 && index % 2 == 0 }); mockFakeActivity(w, function(index) {
return index <= 14 && index % 2 == 0
});
w.updateIndexes(function(err) { w.updateIndexes(function(err) {
w.publicKeyRing.indexes.receiveIndex.should.equal(15); w.publicKeyRing.indexes.receiveIndex.should.equal(15);
w.publicKeyRing.indexes.changeIndex.should.equal(15); w.publicKeyRing.indexes.changeIndex.should.equal(15);
@ -673,7 +683,9 @@ describe('Wallet model', function() {
it('#updateIndexes should store and emit event', function(done) { it('#updateIndexes should store and emit event', function(done) {
var w = createW2(); var w = createW2();
mockFakeActivity(w, function(index) { return index <= 14 && index % 2 == 0 }); mockFakeActivity(w, function(index) {
return index <= 14 && index % 2 == 0
});
var spyStore = sinon.spy(w, 'store'); var spyStore = sinon.spy(w, 'store');
var spyEmit = sinon.spy(w, 'emit'); var spyEmit = sinon.spy(w, 'emit');
w.updateIndexes(function(err) { w.updateIndexes(function(err) {
@ -695,16 +707,13 @@ describe('Wallet model', function() {
done(); done();
}); });
var contacts = [ var contacts = [{
{
label: 'Charles', label: 'Charles',
address: '2N8pJWpXCAxmNLHKVEhz3TtTcYCtHd43xWU ', address: '2N8pJWpXCAxmNLHKVEhz3TtTcYCtHd43xWU ',
}, }, {
{
label: 'Linda', label: 'Linda',
address: '2N4Zq92goYGrf5J4F4SZZq7jnPYbCiyRYT2 ', address: '2N4Zq92goYGrf5J4F4SZZq7jnPYbCiyRYT2 ',
} }];
];
it('should create new entry for address book', function() { it('should create new entry for address book', function() {
var w = createW(); var w = createW();
@ -753,12 +762,6 @@ describe('Wallet model', function() {
data.addressBook['msj42CCGruhRsFrGATiUuh25dtxYtnpbTx'].createdTs = 1403102215; data.addressBook['msj42CCGruhRsFrGATiUuh25dtxYtnpbTx'].createdTs = 1403102215;
w._handleAddressBook('senderID', data, true); w._handleAddressBook('senderID', data, true);
Object.keys(w.addressBook).length.should.equal(3); Object.keys(w.addressBook).length.should.equal(3);
w.sendTxProposal.should.throw('Illegal Argument.');
(function() {
w.sendTxProposal(ntxid)
}).should.not.throw();
done();
});
}); });
it('#getNetworkName', function() { it('#getNetworkName', function() {