status: camelCase adjustments for bitcore node

This commit is contained in:
Braydon Fuller 2016-05-11 11:54:29 -04:00
parent c6bd150bd9
commit 285e3550f5
2 changed files with 22 additions and 4 deletions

View File

@ -45,7 +45,25 @@ StatusController.prototype.show = function(req, res) {
};
StatusController.prototype.getInfo = function(callback) {
this.node.services.bitcoind.getInfo(callback);
this.node.services.bitcoind.getInfo(function(err, result) {
if (err) {
return callback(err);
}
var info = {
version: result.version,
protocolversion: result.protocolVersion,
blocks: result.blocks,
timeoffset: result.timeOffset,
connections: result.connections,
proxy: result.proxy,
difficulty: result.difficulty,
testnet: result.testnet,
relayfee: result.relayFee,
errors: result.errors,
network: result.network
};
callback(null, info);
});
};
StatusController.prototype.getLastBlockHash = function() {

View File

@ -8,13 +8,13 @@ describe('Status', function() {
describe('/status', function() {
var info = {
version: 110000,
protocolversion: 70002,
protocolVersion: 70002,
blocks: 548645,
timeoffset: 0,
timeOffset: 0,
connections: 8,
difficulty: 21546.906405522557,
testnet: true,
relayfee: 1000,
relayFee: 1000,
errors: ''
};