MCPcopy Create free account
hub / github.com/subquery/subql / setBlockHeader

Method setBlockHeader

packages/node-core/src/indexer/store.service.ts:353–367  ·  view source on GitHub ↗
(header: Header)

Source from the content-addressed store, hash-verified

351 }
352
353 async setBlockHeader(header: Header): Promise<void> {
354 this._blockHeader = header;
355
356 if (this.modelProvider instanceof PlainStoreModelService) {
357 assert(!this.#transaction, new Error(`Transaction already exists for height: ${header.blockHeight}`));
358
359 this.#transaction = await this.sequelize.transaction({
360 deferrable: this._historical ? undefined : Deferrable.SET_DEFERRED(),
361 });
362 this.#transaction.afterCommit(() => (this.#transaction = undefined));
363 }
364 if (this.config.proofOfIndex) {
365 this.operationStack = new StoreOperations(this.modelsRelations.models);
366 }
367 }
368
369 getOperationMerkleRoot(): Uint8Array {
370 if (this.config.proofOfIndex) {

Callers 5

rewindMethod · 0.95
runTestMethod · 0.80
cacheFlushFunction · 0.80
preProcessBlockFunction · 0.80

Calls 1

transactionMethod · 0.80

Tested by 1

cacheFlushFunction · 0.64