Browse Source

fix feelevel tests

feat/estimateFee-limit
Ivan Socolsky 8 years ago
parent
commit
fbe2040cbb
No known key found for this signature in database GPG Key ID: FAECE6A05FAA4F56
  1. 50
      test/integration/server.js

50
test/integration/server.js

@ -2211,28 +2211,30 @@ describe('Wallet service', function() {
var server, wallet, levels; var server, wallet, levels;
before(function() { before(function() {
levels = Defaults.FEE_LEVELS; levels = Defaults.FEE_LEVELS;
Defaults.FEE_LEVELS = [{ Defaults.FEE_LEVELS = {
name: 'urgent', btc: [{
nbBlocks: 1, name: 'urgent',
multiplier: 1.5, nbBlocks: 1,
defaultValue: 50000, multiplier: 1.5,
}, { defaultValue: 50000,
name: 'priority', }, {
nbBlocks: 1, name: 'priority',
defaultValue: 50000 nbBlocks: 1,
}, { defaultValue: 50000
name: 'normal', }, {
nbBlocks: 2, name: 'normal',
defaultValue: 40000 nbBlocks: 2,
}, { defaultValue: 40000
name: 'economy', }, {
nbBlocks: 6, name: 'economy',
defaultValue: 25000 nbBlocks: 6,
}, { defaultValue: 25000
name: 'superEconomy', }, {
nbBlocks: 24, name: 'superEconomy',
defaultValue: 10000 nbBlocks: 24,
}]; defaultValue: 10000
}]
};
}); });
after(function() { after(function() {
Defaults.FEE_LEVELS = levels; Defaults.FEE_LEVELS = levels;
@ -2281,7 +2283,7 @@ describe('Wallet service', function() {
fees = _.zipObject(_.map(fees, function(item) { fees = _.zipObject(_.map(fees, function(item) {
return [item.level, item.feePerKb]; return [item.level, item.feePerKb];
})); }));
var defaults = _.zipObject(_.map(Defaults.FEE_LEVELS, function(item) { var defaults = _.zipObject(_.map(Defaults.FEE_LEVELS['btc'], function(item) {
return [item.name, item.defaultValue]; return [item.name, item.defaultValue];
})); }));
fees.priority.should.equal(defaults.priority); fees.priority.should.equal(defaults.priority);
@ -2344,7 +2346,7 @@ describe('Wallet service', function() {
}); });
}); });
it('should get monotonically decreasing fee values', function(done) { it('should get monotonically decreasing fee values', function(done) {
_.find(Defaults.FEE_LEVELS, { _.find(Defaults.FEE_LEVELS['btc'], {
nbBlocks: 6 nbBlocks: 6
}).defaultValue.should.equal(25000); }).defaultValue.should.equal(25000);
helpers.stubFeeLevels({ helpers.stubFeeLevels({

Loading…
Cancel
Save