Minor fixes (address concerns on PR #35)

This commit is contained in:
eordano 2015-03-11 12:50:41 -03:00
parent c846ccdeeb
commit 808b191648
4 changed files with 4 additions and 5 deletions

View File

@ -8,6 +8,5 @@ RPC:
username: username
password: password
protocol: http
network: livenet
host: 127.0.0.1
port: 8332

View File

@ -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);
});
};

View File

@ -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);

View File

@ -20,7 +20,7 @@ describe('TransactionService', function() {
database: database,
rpc: rpc
});
service.should.exist;
should.exist(service);
});
describe('get', function() {