Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/services/fee/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var FeeService = function(options) {
pass: 'local321',
host: 'localhost',
protocol: 'http',
port: this._getDefaultPort()
port: 8332
};
BaseService.call(this, options);

Expand All @@ -34,8 +34,7 @@ FeeService.prototype.stop = function(callback) {

FeeService.prototype.getAPIMethods = function() {
return [
['estimateFee', this, this.estimateFee, 1],
['syncPercentage', this, this.syncPercentage, 0]
['estimateFee', this, this.estimateFee, 1]
];
};

Expand Down
2 changes: 0 additions & 2 deletions lib/services/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ HeaderService.STARTING_CHAINWORK = '00000000000000000000000000000000000000000000

// --- public prototype functions
HeaderService.prototype.subscribe = function(name, emitter) {

console.log(this.subscriptions, name);
this.subscriptions[name].push(emitter);
log.info(emitter.remoteAddress, 'subscribe:', 'header/' + name, 'total:', this.subscriptions[name].length);

Expand Down
47 changes: 47 additions & 0 deletions test/services/fee/index.unit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict';

var sinon = require('sinon');
var FeeService = require('../../../lib/services/fee');

var expect = require('chai').expect;

describe.only('#Fee Service', function() {
var feeService;
var sandbox;
beforeEach(function() {
sandbox = sinon.sandbox.create();
feeService = new FeeService({
"rpc": {
"user": "bitcoin",
"pass": "local321",
"host": "localhost",
"protocol": "http",
"port": 8332
}
});
});

afterEach(function() {
sandbox.restore();
});

/*
Running in regtest mode or unsync'd will return -1
*/

it("Has an estimateFee method", function() {
var method = feeService.getAPIMethods()[0][0];
expect(method).to.equal('estimateFee');
})

it("Can estimate fees", function(done) {
feeService.estimateFee(4, function(err, fee) {
expect(err).to.be.a('null');
expect(fee.result).to.exist;
expect(fee.result).to.be.at.least(-1);
done();
});
})


});