test: add chain state test.

This commit is contained in:
Christopher Jeffrey 2016-11-30 18:44:38 -08:00
parent aad1691f7e
commit c02514a8b3
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -99,6 +99,12 @@ describe('Chain', function() {
}
}));
it('should have correct chain value', cob(function* () {
assert.equal(chain.db.state.value, 55000000000);
assert.equal(chain.db.state.coin, 20);
assert.equal(chain.db.state.tx, 21);
}));
it('should have correct balance', cob(function* () {
var balance;
@ -134,6 +140,12 @@ describe('Chain', function() {
assert(chain.tip.chainwork.cmp(tip1.chainwork) > 0);
}));
it('should have correct chain value', cob(function* () {
assert.equal(chain.db.state.value, 60000000000);
assert.equal(chain.db.state.coin, 21);
assert.equal(chain.db.state.tx, 22);
}));
it('should have correct balance', cob(function* () {
var balance;
@ -195,6 +207,12 @@ describe('Chain', function() {
assert(chain.tip === tip);
}));
it('should have correct chain value', cob(function* () {
assert.equal(chain.db.state.value, 65000000000);
assert.equal(chain.db.state.coin, 23);
assert.equal(chain.db.state.tx, 24);
}));
it('should get coin', cob(function* () {
var block, tx, output, coin;