From 808b191648247c1ad05314e757a475bf1c09f5e6 Mon Sep 17 00:00:00 2001 From: eordano Date: Wed, 11 Mar 2015 12:50:41 -0300 Subject: [PATCH] Minor fixes (address concerns on PR #35) --- config/default.yml | 1 - lib/services/transaction.js | 4 ++-- test/services/block.js | 2 +- test/services/transaction.js | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/default.yml b/config/default.yml index 1d2c9ff1..73a9cd23 100644 --- a/config/default.yml +++ b/config/default.yml @@ -8,6 +8,5 @@ RPC: username: username password: password protocol: http - network: livenet host: 127.0.0.1 port: 8332 diff --git a/lib/services/transaction.js b/lib/services/transaction.js index f62e4aae..ce438b73 100644 --- a/lib/services/transaction.js +++ b/lib/services/transaction.js @@ -34,7 +34,7 @@ TransactionService.transactionRPCtoBitcore = function(rpcResponse) { if (rpcResponse.error) { throw new bitcore.Error(rpcResponse.error); } - return rpcResponse.result; + return new bitcore.Transaction(rpcResponse.result); }; TransactionService.prototype.getTransaction = function(transactionId) { @@ -44,7 +44,7 @@ TransactionService.prototype.getTransaction = function(transactionId) { return Promise.try(function() { return self.rpc.getRawTransactionAsync(transactionId); }).then(function(rawTransaction) { - return new bitcore.Transaction(TransactionService.transactionRPCtoBitcore(rawTransaction)); + return TransactionService.transactionRPCtoBitcore(rawTransaction); }); }; diff --git a/test/services/block.js b/test/services/block.js index ee96cbd1..a85957a5 100644 --- a/test/services/block.js +++ b/test/services/block.js @@ -19,7 +19,7 @@ describe('BlockService', function() { rpc: 'rpc', transactionService: 'txService' }); - blockService.should.exist; + should.exist(blockService); blockService.database.should.equal(database); blockService.rpc.should.equal(rpc); blockService.transactionService.should.equal(txService); diff --git a/test/services/transaction.js b/test/services/transaction.js index 7a66d0d4..7e7fcff8 100644 --- a/test/services/transaction.js +++ b/test/services/transaction.js @@ -20,7 +20,7 @@ describe('TransactionService', function() { database: database, rpc: rpc }); - service.should.exist; + should.exist(service); }); describe('get', function() {