Comparing version 5.0.2-533 to 5.0.2-540
@@ -81,3 +81,3 @@ "use strict"; | ||
if (blockInfo.previousBlockHash !== this.lastProcessedBlockHash) { | ||
throw new errors_1.MismatchedBlockHashError(); | ||
throw new errors_1.MismatchedBlockHashError(blockInfo.blockNumber, this.lastProcessedBlockHash, blockInfo.previousBlockHash); | ||
} | ||
@@ -84,0 +84,0 @@ } |
@@ -122,3 +122,3 @@ "use strict"; | ||
if (blockNumber < this.startAtBlock) { | ||
throw new errors_1.ImproperStartAtBlockError(); | ||
throw new errors_1.ImproperStartAtBlockError(blockNumber, this.startAtBlock); | ||
} | ||
@@ -125,0 +125,0 @@ if (blockNumber > this.headBlockNumber + 1) { |
export declare class MismatchedBlockHashError extends Error { | ||
constructor(); | ||
constructor(currentBlock: number, expectedHash: string, actualHash: string); | ||
} | ||
@@ -11,3 +11,3 @@ export declare class MissingHandlerVersionError extends Error { | ||
export declare class ImproperStartAtBlockError extends Error { | ||
constructor(); | ||
constructor(blockNumber: number, startAtBlock: number); | ||
} | ||
@@ -14,0 +14,0 @@ export declare class ImproperSeekToBlockError extends Error { |
@@ -6,4 +6,5 @@ "use strict"; | ||
class MismatchedBlockHashError extends Error { | ||
constructor() { | ||
super('Block hashes do not match; block not part of current chain.'); | ||
constructor(currentBlock, expectedHash, actualHash) { | ||
super(`Block hashes do not match; block not part of current chain.` | ||
+ ` Current block: ${currentBlock} Expected: ${expectedHash} Found: ${actualHash}`); | ||
Object.setPrototypeOf(this, MismatchedBlockHashError.prototype); | ||
@@ -29,4 +30,4 @@ } | ||
class ImproperStartAtBlockError extends Error { | ||
constructor() { | ||
super('Cannot seek to block before configured `startAtBlock` number.'); | ||
constructor(blockNumber, startAtBlock) { | ||
super(`Cannot seek to block number ${blockNumber} before configured \`startAtBlock\` number ${startAtBlock}. `); | ||
Object.setPrototypeOf(this, ImproperStartAtBlockError.prototype); | ||
@@ -33,0 +34,0 @@ } |
{ | ||
"name": "demux", | ||
"version": "5.0.2-533", | ||
"version": "5.0.2-540", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "block.one", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
127638
1736