Added tests for getting blocks by height.

This commit is contained in:
Braydon Fuller 2015-07-21 18:48:07 -04:00
parent ebdab57b78
commit 5a8dfc1e07
1 changed files with 19 additions and 0 deletions

View File

@ -143,4 +143,23 @@ describe('Basic Functionality', function() {
});
});
describe('get blocks by height', function() {
[0,1,2,3,5,6,7,8,9].forEach(function(i) {
it('generated block ' + i, function(done) {
// add the genesis block
var height = i + 1;
bitcoind.getBlock(i + 1, function(err, response) {
if (err) {
throw err;
}
should.exist(response);
var block = bitcore.Block.fromBuffer(response);
block.hash.should.equal(blockHashes[i]);
done();
});
});
});
});
});