Comparing version 5.0.2-557 to 5.0.2-560
@@ -25,3 +25,3 @@ /// <reference types="bunyan" /> | ||
private maxEffectErrors; | ||
private validateBlockHashes; | ||
private validateBlocks; | ||
/** | ||
@@ -28,0 +28,0 @@ * @param handlerVersions An array of `HandlerVersion`s that are to be used when processing blocks. The default |
@@ -40,3 +40,3 @@ "use strict"; | ||
this.effectErrors = []; | ||
const optionsWithDefaults = Object.assign({ effectRunMode: interfaces_1.EffectRunMode.All, logSource: 'AbstractActionHandler', logLevel: 'info', maxEffectErrors: 100, validateBlockHashes: true }, options); | ||
const optionsWithDefaults = Object.assign({ effectRunMode: interfaces_1.EffectRunMode.All, logSource: 'AbstractActionHandler', logLevel: 'info', maxEffectErrors: 100, validateBlocks: true }, options); | ||
this.initHandlerVersions(handlerVersions); | ||
@@ -46,3 +46,3 @@ this.effectRunMode = optionsWithDefaults.effectRunMode; | ||
this.log = BunyanProvider_1.BunyanProvider.getLogger(optionsWithDefaults); | ||
this.validateBlockHashes = optionsWithDefaults.validateBlockHashes; | ||
this.validateBlocks = optionsWithDefaults.validateBlocks; | ||
} | ||
@@ -75,3 +75,3 @@ /** | ||
// Only check if this is the block we need if it's not the first block | ||
if (!isEarliestBlock) { | ||
if (!isEarliestBlock && this.validateBlocks) { | ||
if (blockInfo.blockNumber !== nextBlockNeeded) { | ||
@@ -83,3 +83,3 @@ this.log.debug(`Got block ${blockInfo.blockNumber} but block ${nextBlockNeeded} is needed; ` + | ||
// Block sequence consistency should be handled by the ActionReader instance | ||
if (blockInfo.previousBlockHash !== this.lastProcessedBlockHash && this.validateBlockHashes) { | ||
if (blockInfo.previousBlockHash !== this.lastProcessedBlockHash) { | ||
throw new errors_1.MismatchedBlockHashError(blockInfo.blockNumber, this.lastProcessedBlockHash, blockInfo.previousBlockHash); | ||
@@ -86,0 +86,0 @@ } |
@@ -46,3 +46,3 @@ /// <reference types="bunyan" /> | ||
maxEffectErrors?: number; | ||
validateBlockHashes?: boolean; | ||
validateBlocks?: boolean; | ||
} | ||
@@ -49,0 +49,0 @@ export interface Block { |
{ | ||
"name": "demux", | ||
"version": "5.0.2-557", | ||
"version": "5.0.2-560", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "block.one", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130310