Browse Source

rebase

activeAddress
Ivan Socolsky 9 years ago
parent
commit
4e7f1f39d9
No known key found for this signature in database GPG Key ID: FAECE6A05FAA4F56
  1. 1
      lib/storage.js
  2. 11
      test/integration/server.js

1
lib/storage.js

@ -741,7 +741,6 @@ Storage.prototype.storeTxHistoryCache = function(walletId, totalItems, firstPosi
}, function(err) { }, function(err) {
if (err) return cb(err); if (err) return cb(err);
>>> >>> > store txs individually
self.db.collection(collections.CACHE).update({ self.db.collection(collections.CACHE).update({
walletId: walletId, walletId: walletId,
type: 'historyCacheStatus', type: 'historyCacheStatus',

11
test/integration/server.js

@ -6221,7 +6221,7 @@ describe('Wallet service', function() {
}); });
}); });
describe.only('#getTxHistory cache', function() { describe('#getTxHistory cache', function() {
var server, wallet, mainAddresses, changeAddresses; var server, wallet, mainAddresses, changeAddresses;
var _threshold = Defaults.HISTORY_CACHE_ADDRESS_THRESOLD; var _threshold = Defaults.HISTORY_CACHE_ADDRESS_THRESOLD;
beforeEach(function(done) { beforeEach(function(done) {
@ -6413,7 +6413,6 @@ describe('Wallet service', function() {
skip: i, skip: i,
limit: 5, limit: 5,
}, function(err, txs, fromCache) { }, function(err, txs, fromCache) {
should.not.exist(err); should.not.exist(err);
should.exist(txs); should.exist(txs);
txs.length.should.equal(5); txs.length.should.equal(5);
@ -6423,15 +6422,15 @@ describe('Wallet service', function() {
next(); next();
}); });
}, function() { }, function() {
// Ask more that cached. async.eachSeries(_.range(0, 200, 5), function(i, next) {
async.eachSeries(_.range(0, 210, 7), function(i, next) {
server.getTxHistory({ server.getTxHistory({
skip: i, skip: i,
limit: 7, limit: 5,
}, function(err, txs, fromCache) { }, function(err, txs, fromCache) {
should.not.exist(err); should.not.exist(err);
should.exist(txs); should.exist(txs);
var s = h.slice(i, i + 7); txs.length.should.equal(5);
var s = h.slice(i, i + 5);
_.pluck(txs, 'txid').should.deep.equal(_.pluck(s, 'txid')); _.pluck(txs, 'txid').should.deep.equal(_.pluck(s, 'txid'));
fromCache.should.equal(i >= Defaults.CONFIRMATIONS_TO_START_CACHING && i < 200); fromCache.should.equal(i >= Defaults.CONFIRMATIONS_TO_START_CACHING && i < 200);
next(); next();

Loading…
Cancel
Save