|
|
@ -201,7 +201,7 @@ helpers.stubHistory = function(txs) { |
|
|
|
helpers.stubFeeLevels = function(levels) { |
|
|
|
blockchainExplorer.estimateFee = function(nbBlocks, cb) { |
|
|
|
return cb(null, { |
|
|
|
feePerKB: levels[nbBlocks] / 1e8 || -1 |
|
|
|
feePerKB: levels[nbBlocks] / 1e8 |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -1463,9 +1463,9 @@ describe('Wallet service', function() { |
|
|
|
|
|
|
|
it('should get current fee levels', function(done) { |
|
|
|
helpers.stubFeeLevels({ |
|
|
|
2: 40000, |
|
|
|
6: 20000, |
|
|
|
25: 18000, |
|
|
|
1: 40000, |
|
|
|
3: 20000, |
|
|
|
10: 18000, |
|
|
|
}); |
|
|
|
server.getFeeLevels({}, function(err, fees) { |
|
|
|
should.not.exist(err); |
|
|
@ -1495,9 +1495,9 @@ describe('Wallet service', function() { |
|
|
|
}); |
|
|
|
it('should get default fees if network cannot estimate (returns -1)', function(done) { |
|
|
|
helpers.stubFeeLevels({ |
|
|
|
2: -1, |
|
|
|
6: 18000, |
|
|
|
25: 0, |
|
|
|
1: -1, |
|
|
|
3: 18000, |
|
|
|
10: 0, |
|
|
|
}); |
|
|
|
server.getFeeLevels({}, function(err, fees) { |
|
|
|
should.not.exist(err); |
|
|
@ -1507,7 +1507,7 @@ describe('Wallet service', function() { |
|
|
|
fees.emergency.should.equal(50000); |
|
|
|
fees.priority.should.equal(20000); |
|
|
|
fees.normal.should.equal(18000); |
|
|
|
fees.economy.should.equal(5000); |
|
|
|
fees.economy.should.equal(0); |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}); |
|
|
|