upgrade to bitcore v0.12.0

This commit is contained in:
Manuel Araoz 2015-04-29 19:05:22 -03:00
parent d6aeb2d81a
commit 6974c35a05
3 changed files with 7 additions and 5 deletions

View File

@ -9,7 +9,7 @@ blockHexs.map(function(hex) {
var block = new Block(new Buffer(hex, 'hex'));
return block;
}).forEach(function(block) {
mockBlocks[block.id] = block;
mockBlocks[block.id] = block.toObject();
});
module.exports = mockBlocks;

View File

@ -53,13 +53,15 @@ describe('BitcoreHTTP v1 blocks routes', function() {
var start = from - 1e5;
var end = to - 1e5;
var section = blockList.slice(start, end);
return Promise.resolve(section.slice(offset, offset + limit));
var ret = section.slice(offset, offset + limit);
console.log(ret);
return Promise.resolve(ret);
};
app = require('../app')(nodeMock);
agent = request(app);
});
describe('/blocks', function() {
describe.only('/blocks', function() {
it('works with default parameters', function(cb) {
agent.get('/v1/blocks/')
.expect(200)
@ -95,7 +97,7 @@ describe('BitcoreHTTP v1 blocks routes', function() {
it('returns latest block', function(cb) {
agent.get('/v1/blocks/latest')
.expect(200)
.expect(lastBlock.toJSON(), cb);
.expect(lastBlock, cb);
});
});
describe('/blocks/:blockHash', function() {

View File

@ -34,7 +34,7 @@
"dependencies": {
"async": "0.9.0",
"bitcoind-rpc": "^0.2.1",
"bitcore": "bitpay/bitcore",
"bitcore": "^0.12.0",
"bitcore-p2p": "^0.13.0",
"bluebird": "^2.9.12",
"body-parser": "^1.12.0",