From 86d1818940eb9943929de07f4d4330dd2f4f78b5 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Thu, 23 Jul 2015 09:25:52 -0300 Subject: [PATCH] send back nbBlocks for each level --- lib/server.js | 1 + test/integration/server.js | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/server.js b/lib/server.js index 6998dec..8ed97d2 100644 --- a/lib/server.js +++ b/lib/server.js @@ -819,6 +819,7 @@ WalletService.prototype.getFeeLevels = function(opts, cb) { return { level: level.name, feePerKB: feePerKB, + nbBlocks: level.nbBlocks, }; }); diff --git a/test/integration/server.js b/test/integration/server.js index e48e647..45e851b 100644 --- a/test/integration/server.js +++ b/test/integration/server.js @@ -1458,7 +1458,7 @@ describe('Wallet service', function() { }); }); - describe.only('#getFeeLevels', function() { + describe('#getFeeLevels', function() { var server, wallet; beforeEach(function(done) { helpers.createAndJoinWallet(1, 1, function(s, w) { @@ -1477,11 +1477,16 @@ describe('Wallet service', function() { server.getFeeLevels({}, function(err, fees) { should.not.exist(err); fees = _.zipObject(_.map(fees, function(item) { - return [item.level, item.feePerKB]; + return [item.level, item]; })); - fees.priority.should.equal(40000); - fees.normal.should.equal(20000); - fees.economy.should.equal(18000); + fees.priority.feePerKB.should.equal(40000); + fees.priority.nbBlocks.should.equal(1); + + fees.normal.feePerKB.should.equal(20000); + fees.normal.nbBlocks.should.equal(4); + + fees.economy.feePerKB.should.equal(18000); + fees.economy.nbBlocks.should.equal(12); done(); }); });