Minor fixes (address concerns on PR #35)
This commit is contained in:
parent
c846ccdeeb
commit
808b191648
@ -8,6 +8,5 @@ RPC:
|
|||||||
username: username
|
username: username
|
||||||
password: password
|
password: password
|
||||||
protocol: http
|
protocol: http
|
||||||
network: livenet
|
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 8332
|
port: 8332
|
||||||
|
|||||||
@ -34,7 +34,7 @@ TransactionService.transactionRPCtoBitcore = function(rpcResponse) {
|
|||||||
if (rpcResponse.error) {
|
if (rpcResponse.error) {
|
||||||
throw new bitcore.Error(rpcResponse.error);
|
throw new bitcore.Error(rpcResponse.error);
|
||||||
}
|
}
|
||||||
return rpcResponse.result;
|
return new bitcore.Transaction(rpcResponse.result);
|
||||||
};
|
};
|
||||||
|
|
||||||
TransactionService.prototype.getTransaction = function(transactionId) {
|
TransactionService.prototype.getTransaction = function(transactionId) {
|
||||||
@ -44,7 +44,7 @@ TransactionService.prototype.getTransaction = function(transactionId) {
|
|||||||
return Promise.try(function() {
|
return Promise.try(function() {
|
||||||
return self.rpc.getRawTransactionAsync(transactionId);
|
return self.rpc.getRawTransactionAsync(transactionId);
|
||||||
}).then(function(rawTransaction) {
|
}).then(function(rawTransaction) {
|
||||||
return new bitcore.Transaction(TransactionService.transactionRPCtoBitcore(rawTransaction));
|
return TransactionService.transactionRPCtoBitcore(rawTransaction);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ describe('BlockService', function() {
|
|||||||
rpc: 'rpc',
|
rpc: 'rpc',
|
||||||
transactionService: 'txService'
|
transactionService: 'txService'
|
||||||
});
|
});
|
||||||
blockService.should.exist;
|
should.exist(blockService);
|
||||||
blockService.database.should.equal(database);
|
blockService.database.should.equal(database);
|
||||||
blockService.rpc.should.equal(rpc);
|
blockService.rpc.should.equal(rpc);
|
||||||
blockService.transactionService.should.equal(txService);
|
blockService.transactionService.should.equal(txService);
|
||||||
|
|||||||
@ -20,7 +20,7 @@ describe('TransactionService', function() {
|
|||||||
database: database,
|
database: database,
|
||||||
rpc: rpc
|
rpc: rpc
|
||||||
});
|
});
|
||||||
service.should.exist;
|
should.exist(service);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('get', function() {
|
describe('get', function() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user