From c02514a8b3c84c4dca521ce5a8289e203711c92d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 30 Nov 2016 18:44:38 -0800 Subject: [PATCH] test: add chain state test. --- test/chain-test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/chain-test.js b/test/chain-test.js index d797a35a..468cfad2 100644 --- a/test/chain-test.js +++ b/test/chain-test.js @@ -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;