Skip to content

Commit

Permalink
fix(viewState): fetch block data for sortKey on viewState evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler authored and asiaziola committed Mar 4, 2024
1 parent 024ed9b commit 40f4f45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/contract/HandlerBasedContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Check failure on line 854 in src/contract/HandlerBasedContract.ts

View workflow job for this annotation

GitHub Actions / build

Do not nest ternary expressions
? await this._arweaveWrapper.warpGwBlock()
: blockHeight
? await arweave.blocks.getByHeight(blockHeight)
: await arweave.blocks.getCurrent();

// add caller info to execution context
Expand Down

0 comments on commit 40f4f45

Please sign in to comment.