Skip to content
Snippets Groups Projects
Commit c5612531 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] CLI: `gen-next` was not using the indexer to test the block

parent 98edd24d
Branches
Tags
No related merge requests found
......@@ -107,6 +107,10 @@ function BlockchainContext() {
this.checkBlock = (block, withPoWAndSignature) => co(function*(){
if (withPoWAndSignature) {
yield Q.nbind(rules.CHECK.ASYNC.ALL_LOCAL, rules, block, conf);
}
else {
yield Q.nbind(rules.CHECK.ASYNC.ALL_LOCAL_BUT_POW, rules, block, conf);
}
const index = indexer.localIndex(block, conf);
const mindex = indexer.mindex(index);
const iindex = indexer.iindex(index);
......@@ -144,8 +148,10 @@ function BlockchainContext() {
if (indexer.ruleMembersCount(block, HEAD) === false) throw Error('ruleMembersCount');
// BR_G61
if (indexer.rulePowMin(block, HEAD) === false) throw Error('rulePowMin');
if (withPoWAndSignature) {
// BR_G62
if (indexer.ruleProofOfWork(HEAD) === false) throw Error('ruleProofOfWork');
}
// BR_G63
if (indexer.ruleIdentityWritability(iindex, conf) === false) throw Error('ruleIdentityWritability');
// BR_G64
......@@ -204,10 +210,6 @@ function BlockchainContext() {
if (indexer.ruleInputIsTimeUnlocked(sindex) === false) throw Error('ruleInputIsTimeUnlocked');
// BR_G90
if (indexer.ruleOutputBase(sindex, HEAD_1) === false) throw Error('ruleOutputBase');
}
else {
yield Q.nbind(rules.CHECK.ASYNC.ALL_LOCAL_BUT_POW, rules, block, conf);
}
// Check document's coherence
yield checkIssuer(block);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment