lisk-framework
Version:
Lisk blockchain application platform
44 lines • 1.75 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenerationContext = void 0;
const lisk_chain_1 = require("@liskhq/lisk-chain");
const method_context_1 = require("./method_context");
const event_queue_1 = require("./event_queue");
class GenerationContext {
constructor(args) {
this._logger = args.logger;
this._chainID = args.chainID;
this._header = args.header;
this._stateStore = args.stateStore;
this._contextStore = args.contextStore;
this._generatorStore = args.generatorStore;
this._assets = new lisk_chain_1.BlockAssets();
this._finalizedHeight = args.finalizedHeight;
}
get blockHeader() {
return this._header;
}
getInsertAssetContext() {
return {
logger: this._logger,
getMethodContext: () => (0, method_context_1.createMethodContext)({
stateStore: this._stateStore,
eventQueue: new event_queue_1.EventQueue(this._header.height),
contextStore: this._contextStore,
}),
contextStore: this._contextStore,
getStore: (moduleID, storePrefix) => this._stateStore.getStore(moduleID, storePrefix),
stateStore: this._stateStore,
getOffchainStore: (moduleID, subStorePrefix) => this._generatorStore.getStore(moduleID, subStorePrefix.readUInt16BE(0)),
header: this._header,
assets: this._assets,
chainID: this._chainID,
getFinalizedHeight: () => this._finalizedHeight,
};
}
get assets() {
return this._assets;
}
}
exports.GenerationContext = GenerationContext;
//# sourceMappingURL=generator_context.js.map