test: add chain test for removeChains.

This commit is contained in:
Christopher Jeffrey 2016-11-11 14:02:32 -08:00
parent ef8b205a38
commit 41f711987c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -233,6 +233,20 @@ describe('Chain', function() {
assert.equal(txs.length, 44);
}));
it('should get tips and remove chains', cob(function* () {
var tips = yield chain.db.getTips();
assert.notEqual(tips.indexOf(chain.tip.hash), -1);
assert.equal(tips.length, 2);
yield chain.db.removeChains();
tips = yield chain.db.getTips();
assert.notEqual(tips.indexOf(chain.tip.hash), -1);
assert.equal(tips.length, 1);
}));
it('should rescan for transactions', cob(function* () {
var total = 0;