Comparing version 4.0.1-ff84e5a.0 to 5.0.1-82d098a.0
import * as Logger from 'bunyan'; | ||
import { Block, HandlerInfo, HandlerVersion, IndexState, NextBlock, VersionedAction } from './interfaces'; | ||
import { HandlerInfo, HandlerVersion, IndexState, NextBlock, VersionedAction } from './interfaces'; | ||
/** | ||
@@ -39,3 +39,3 @@ * Takes `block`s output from implementations of `AbstractActionReader` and processes their actions through the | ||
*/ | ||
protected abstract updateIndexState(state: any, block: Block, isReplay: boolean, handlerVersionName: string, context?: any): Promise<void>; | ||
protected abstract updateIndexState(state: any, nextBlock: NextBlock, isReplay: boolean, handlerVersionName: string, context?: any): Promise<void>; | ||
/** | ||
@@ -75,3 +75,3 @@ * Returns a promise for the `lastProcessedBlockNumber` and `lastProcessedBlockHash` meta state, | ||
*/ | ||
protected applyUpdaters(state: any, block: Block, context: any, isReplay: boolean): Promise<VersionedAction[]>; | ||
protected applyUpdaters(state: any, nextBlock: NextBlock, context: any, isReplay: boolean): Promise<VersionedAction[]>; | ||
/** | ||
@@ -78,0 +78,0 @@ * Process versioned actions against asynchronous side effects. |
@@ -121,6 +121,6 @@ "use strict"; | ||
*/ | ||
applyUpdaters(state, block, context, isReplay) { | ||
applyUpdaters(state, nextBlock, context, isReplay) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const versionedActions = []; | ||
const { actions, blockInfo } = block; | ||
const { block: { actions, blockInfo } } = nextBlock; | ||
for (const action of actions) { | ||
@@ -139,3 +139,3 @@ let updaterIndex = -1; | ||
this.warnSkippingUpdaters(updaterIndex, action.type); | ||
yield this.updateIndexState(state, block, isReplay, newVersion, context); | ||
yield this.updateIndexState(state, nextBlock, isReplay, newVersion, context); | ||
this.handlerVersionName = newVersion; | ||
@@ -174,7 +174,7 @@ break; | ||
const { blockInfo } = block; | ||
const versionedActions = yield this.applyUpdaters(state, block, context, isReplay); | ||
const versionedActions = yield this.applyUpdaters(state, nextBlock, context, isReplay); | ||
if (!isReplay) { | ||
this.runEffects(versionedActions, context, nextBlock); | ||
} | ||
yield this.updateIndexState(state, block, isReplay, this.handlerVersionName, context); | ||
yield this.updateIndexState(state, nextBlock, isReplay, this.handlerVersionName, context); | ||
this.lastProcessedBlockNumber = blockInfo.blockNumber; | ||
@@ -181,0 +181,0 @@ this.lastProcessedBlockHash = blockInfo.blockHash; |
@@ -27,2 +27,3 @@ export interface ActionReaderOptions { | ||
blockNumber: number; | ||
lastIrreversibleBlockNumber: number; | ||
blockHash: string; | ||
@@ -29,0 +30,0 @@ handlerVersionName: string; |
{ | ||
"name": "demux", | ||
"version": "4.0.1-ff84e5a.0", | ||
"version": "5.0.1-82d098a.0", | ||
"author": { | ||
@@ -39,8 +39,9 @@ "name": "Julien Heller", | ||
"build": "rm -rf dist/* && tsc", | ||
"build-docs": "./scripts/build-docs.sh", | ||
"build-all": "rm -rf dist/* && tsc && ./scripts/build-docs.sh", | ||
"build-docs": "rm -rf docs && ./scripts/build-docs.sh", | ||
"build-all": "yarn build && yarn build-docs", | ||
"example": "./scripts/run-example.sh", | ||
"lint": "tslint -c tslint.json -p tsconfig.json", | ||
"test": "jest --detectOpenHandles --maxWorkers=2", | ||
"current-version": "echo $npm_package_version" | ||
"current-version": "echo $npm_package_version", | ||
"prepublishOnly": "yarn build" | ||
}, | ||
@@ -47,0 +48,0 @@ "jest": { |
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
90406
1305