block integration test fixed

This commit is contained in:
Manuel Araoz 2014-02-11 13:02:28 -03:00
parent 8edf753883
commit 9f6e340364
2 changed files with 31 additions and 29 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/env node
'use strict';
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
@ -19,10 +20,9 @@ describe('Address balances', function(){
addrValid.forEach(function(v) {
if (v.disabled) {
console.log(v.addr + " => disabled in JSON");
}
else {
it('Info for: ' + v.addr, function(done) {
console.log(v.addr + ' => disabled in JSON');
} else {
it('Address info for: ' + v.addr, function(done) {
this.timeout(5000);
var a = new Address(v.addr, txDb);
@ -50,4 +50,3 @@ describe('Address balances', function(){
});
});

View File

@ -1,4 +1,5 @@
#!/usr/bin/env node
'use strict';
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
@ -15,7 +16,6 @@ var bDb;
describe('BlockDb fromHashWithInfo', function() {
before(function(c) {
bDb = new BlockDb();
return c();
@ -24,9 +24,13 @@ describe('BlockDb fromHashWithInfo', function(){
it('should poll block\'s info from bitcoind', function(done) {
bDb.fromHashWithInfo(TESTING_BLOCK, function(err, b2) {
if (err) done(err);
assert.equal(b2.hash, TESTING_BLOCK);
assert.equal(b2.info.hash, TESTING_BLOCK);
assert.equal(b2.info.chainwork, '000000000000000000000000000000000000000000000000001b6dc969ffe847');
assert.equal(b2.hash, TESTING_BLOCK, 'hash');
assert.equal(b2.info.hash, TESTING_BLOCK, 'info.hash');
assert.equal(b2.info.height, 71619);
assert.equal(b2.info.nonce, 3960980741);
assert.equal(b2.info.bits, '1c018c14');
assert.equal(b2.info.merkleroot, '9a326cb524aa2e5bc926b8c1f6de5b01257929ee02158054b55aae93a55ec9dd');
assert.equal(b2.info.nextblockhash, '000000000121941b3b10d76fbe67b35993df91eb3398e9153e140b4f6213cb84');
done();
});
});
@ -37,4 +41,3 @@ describe('BlockDb fromHashWithInfo', function(){
});
});
});