fix(viewState): fetch block data for sortKey on viewState evaluation
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
"homepage": "https://github.com/warp-contracts/warp#readme",
|
||||
"dependencies": {
|
||||
"archiver": "^5.3.0",
|
||||
"arweave": "1.13.7",
|
||||
"arweave": "1.14.4",
|
||||
"async-mutex": "^0.4.0",
|
||||
"bignumber.js": "9.1.1",
|
||||
"events": "3.3.0",
|
||||
|
||||
@@ -849,9 +849,12 @@ export class HandlerBasedContract<State> implements Contract<State> {
|
||||
// create execution context
|
||||
let executionContext = await this.createExecutionContext(this._contractTxId, sortKey, true, undefined, signal);
|
||||
|
||||
const blockHeight = sortKey ? await this._sorter.extractBlockHeight(sortKey) : undefined;
|
||||
const currentBlockData =
|
||||
this.warp.environment == 'mainnet' && !(this.warp.interactionsLoader.type() === 'arweave')
|
||||
? await this._arweaveWrapper.warpGwBlock()
|
||||
: blockHeight
|
||||
? await arweave.blocks.getByHeight(blockHeight)
|
||||
: await arweave.blocks.getCurrent();
|
||||
|
||||
// add caller info to execution context
|
||||
|
||||
Reference in New Issue
Block a user