all block integration tests working
This commit is contained in:
parent
9ac13de824
commit
c8c4d28d42
@ -48,6 +48,9 @@ Blocks.heightParam = function(req, res, next, height) {
|
||||
.then(next)
|
||||
.catch(BitcoreNode.errors.Blocks.NotFound, function() {
|
||||
res.status(404).send('Block with height ' + height + ' not found');
|
||||
})
|
||||
.catch(function() {
|
||||
console.log(arguments);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ describe('BitcoreHTTP v1 blocks routes', function() {
|
||||
return b.toObject();
|
||||
};
|
||||
|
||||
describe.only('/blocks', function() {
|
||||
describe('/blocks', function() {
|
||||
it('works with default parameters', function(cb) {
|
||||
agent.get('/v1/blocks/?from=100000')
|
||||
.expect(200)
|
||||
|
||||
@ -109,12 +109,11 @@ BlockService.blockRPCtoBitcore = function(blockData) {
|
||||
* @return {Promise} a promise that will always be rejected
|
||||
*/
|
||||
var blockNotFound = function(err) {
|
||||
if (err instanceof Error) {
|
||||
throw err;
|
||||
}
|
||||
if (err.message === 'Block not found') {
|
||||
if (err.message === 'Block not found' ||
|
||||
err.message === 'Block height out of range') {
|
||||
throw new errors.Blocks.NotFound();
|
||||
}
|
||||
throw err;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user