fix tests
This commit is contained in:
parent
a99e37bbdc
commit
e4ebb535ca
4 changed files with 11 additions and 9 deletions
|
|
@ -2452,9 +2452,9 @@ Wallet.prototype.updateIndexes = function(callback) {
|
||||||
async.parallel(tasks, function(err) {
|
async.parallel(tasks, function(err) {
|
||||||
if (err) callback(err);
|
if (err) callback(err);
|
||||||
log.debug('Wallet:' + self.id + ' Indexes updated');
|
log.debug('Wallet:' + self.id + ' Indexes updated');
|
||||||
this.clearUnspentCache();
|
self.clearUnspentCache();
|
||||||
this.subscribeToAddresses();
|
self.subscribeToAddresses();
|
||||||
this.emitAndKeepAlive('newAddresses');
|
self.emitAndKeepAlive('newAddresses');
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ module.exports = {
|
||||||
_success: function() {;
|
_success: function() {;
|
||||||
},
|
},
|
||||||
_error: function(_, err) {
|
_error: function(_, err) {
|
||||||
|
console.trace(err);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -687,6 +687,7 @@ describe('Wallet model', function() {
|
||||||
amount: u
|
amount: u
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
w.clearUnspentCache();
|
||||||
w.getBalance(function(err, balance, balanceByAddr, safeBalance) {
|
w.getBalance(function(err, balance, balanceByAddr, safeBalance) {
|
||||||
balance.should.equal(c.balance);
|
balance.should.equal(c.balance);
|
||||||
done();
|
done();
|
||||||
|
|
@ -821,7 +822,7 @@ describe('Wallet model', function() {
|
||||||
should.exist(id);
|
should.exist(id);
|
||||||
status.should.equal(Wallet.TX_PROPOSAL_SENT);
|
status.should.equal(Wallet.TX_PROPOSAL_SENT);
|
||||||
w.sendTxProposal.calledOnce.should.equal(true);
|
w.sendTxProposal.calledOnce.should.equal(true);
|
||||||
w.sendIndexes.calledOnce.should.equal(true);
|
w.sendIndexes.calledOnce.should.equal(false);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -861,7 +862,7 @@ describe('Wallet model', function() {
|
||||||
}, function(err, id, status) {
|
}, function(err, id, status) {
|
||||||
err.should.equal('error');
|
err.should.equal('error');
|
||||||
w.sendTxProposal.calledOnce.should.equal(false);
|
w.sendTxProposal.calledOnce.should.equal(false);
|
||||||
w.sendIndexes.calledOnce.should.equal(true);
|
w.sendIndexes.calledOnce.should.equal(false);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -75,15 +75,15 @@ describe('http utils', function() {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should get with default error', function() {
|
it('should get with default error', function(done) {
|
||||||
xhr.error = 1;
|
xhr.error = 1;
|
||||||
|
|
||||||
var ret = httpUtils.request({
|
var ret = httpUtils.request({
|
||||||
xhr: xhr,
|
xhr: xhr,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: 'http://test',
|
url: 'http://test',
|
||||||
});
|
}).error(function(){
|
||||||
ret._error.should.throw()
|
done();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue