fix format
This commit is contained in:
parent
dae5c9d3d5
commit
9f87156adc
@ -90,7 +90,8 @@ AddressService.prototype.start = function(callback) {
|
|||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
self.mempoolIndex = levelup(
|
self.mempoolIndex = levelup(
|
||||||
self.mempoolIndexPath, {
|
self.mempoolIndexPath,
|
||||||
|
{
|
||||||
db: self.levelupStore,
|
db: self.levelupStore,
|
||||||
keyEncoding: 'binary',
|
keyEncoding: 'binary',
|
||||||
valueEncoding: 'binary',
|
valueEncoding: 'binary',
|
||||||
@ -155,17 +156,20 @@ AddressService.prototype.getAPIMethods = function() {
|
|||||||
* Called by the Bus to get the available events for this service.
|
* Called by the Bus to get the available events for this service.
|
||||||
*/
|
*/
|
||||||
AddressService.prototype.getPublishEvents = function() {
|
AddressService.prototype.getPublishEvents = function() {
|
||||||
return [{
|
return [
|
||||||
|
{
|
||||||
name: 'address/transaction',
|
name: 'address/transaction',
|
||||||
scope: this,
|
scope: this,
|
||||||
subscribe: this.subscribe.bind(this, 'address/transaction'),
|
subscribe: this.subscribe.bind(this, 'address/transaction'),
|
||||||
unsubscribe: this.unsubscribe.bind(this, 'address/transaction')
|
unsubscribe: this.unsubscribe.bind(this, 'address/transaction')
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
name: 'address/balance',
|
name: 'address/balance',
|
||||||
scope: this,
|
scope: this,
|
||||||
subscribe: this.subscribe.bind(this, 'address/balance'),
|
subscribe: this.subscribe.bind(this, 'address/balance'),
|
||||||
unsubscribe: this.unsubscribe.bind(this, 'address/balance')
|
unsubscribe: this.unsubscribe.bind(this, 'address/balance')
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1220,9 +1224,7 @@ AddressService.prototype.getUnspentOutputsForAddress = function(address, queryMe
|
|||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.getOutputs(address, {
|
this.getOutputs(address, {queryMempool: queryMempool}, function(err, outputs) {
|
||||||
queryMempool: queryMempool
|
|
||||||
}, function(err, outputs) {
|
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
} else if(!outputs.length) {
|
} else if(!outputs.length) {
|
||||||
@ -1350,7 +1352,6 @@ AddressService.prototype.getAddressSummary = function(addressArg, options, callb
|
|||||||
}
|
}
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
|
|
||||||
function(next) {
|
function(next) {
|
||||||
self._getAddressConfirmedSummary(address, options, next);
|
self._getAddressConfirmedSummary(address, options, next);
|
||||||
},
|
},
|
||||||
@ -1372,7 +1373,9 @@ AddressService.prototype.getAddressSummary = function(addressArg, options, callb
|
|||||||
var seconds = Math.round(timeDelta / 1000);
|
var seconds = Math.round(timeDelta / 1000);
|
||||||
log.warn('Slow (' + seconds + 's) getAddressSummary request for address: ' + address.toString());
|
log.warn('Slow (' + seconds + 's) getAddressSummary request for address: ' + address.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(null, summary);
|
callback(null, summary);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -1388,7 +1391,6 @@ AddressService.prototype._getAddressConfirmedSummary = function(address, options
|
|||||||
};
|
};
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
|
|
||||||
function(next) {
|
function(next) {
|
||||||
self._getAddressConfirmedInputsSummary(address, baseResult, options, next);
|
self._getAddressConfirmedInputsSummary(address, baseResult, options, next);
|
||||||
},
|
},
|
||||||
@ -1528,7 +1530,6 @@ AddressService.prototype._getAddressMempoolSummary = function(address, options,
|
|||||||
}
|
}
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
|
|
||||||
function(next) {
|
function(next) {
|
||||||
self._getInputsMempool(addressStr, hashBuffer, hashTypeBuffer, function(err, mempoolInputs) {
|
self._getInputsMempool(addressStr, hashBuffer, hashTypeBuffer, function(err, mempoolInputs) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -1541,8 +1542,7 @@ AddressService.prototype._getAddressMempoolSummary = function(address, options,
|
|||||||
next(null, result);
|
next(null, result);
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
}, function(result, next) {
|
||||||
function(result, next) {
|
|
||||||
self._getOutputsMempool(addressStr, hashBuffer, hashTypeBuffer, function(err, mempoolOutputs) {
|
self._getOutputsMempool(addressStr, hashBuffer, hashTypeBuffer, function(err, mempoolOutputs) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
|
|||||||
@ -122,7 +122,9 @@ describe('Address Service History', function() {
|
|||||||
history.get(function() {
|
history.get(function() {
|
||||||
history.node.services.address.getAddressSummary.callCount.should.equal(1);
|
history.node.services.address.getAddressSummary.callCount.should.equal(1);
|
||||||
history.node.services.address.getAddressSummary.args[0][0].should.equal(address);
|
history.node.services.address.getAddressSummary.args[0][0].should.equal(address);
|
||||||
history.node.services.address.getAddressSummary.args[0][1].should.equal(options);
|
history.node.services.address.getAddressSummary.args[0][1].should.equal({
|
||||||
|
noBalance: true,
|
||||||
|
});
|
||||||
history._paginateWithDetails.callCount.should.equal(1);
|
history._paginateWithDetails.callCount.should.equal(1);
|
||||||
history._paginateWithDetails.args[0][0].should.equal(txids);
|
history._paginateWithDetails.args[0][0].should.equal(txids);
|
||||||
history._mergeAndSortTxids.callCount.should.equal(0);
|
history._mergeAndSortTxids.callCount.should.equal(0);
|
||||||
@ -155,7 +157,6 @@ describe('Address Service History', function() {
|
|||||||
history.node.services.address.getAddressSummary.args[0][0].should.equal(address);
|
history.node.services.address.getAddressSummary.args[0][0].should.equal(address);
|
||||||
history.node.services.address.getAddressSummary.args[0][1].should.deep.equal({
|
history.node.services.address.getAddressSummary.args[0][1].should.deep.equal({
|
||||||
fullTxList: true,
|
fullTxList: true,
|
||||||
noBalance: true,
|
|
||||||
});
|
});
|
||||||
history._paginateWithDetails.callCount.should.equal(1);
|
history._paginateWithDetails.callCount.should.equal(1);
|
||||||
history._paginateWithDetails.args[0][0].should.equal(txids);
|
history._paginateWithDetails.args[0][0].should.equal(txids);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user