Skip to content

Commit

Permalink
fix(execution context): when loading interactions for arweave gateway…
Browse files Browse the repository at this point in the history
… type, use arweave gateway for blockheight.
  • Loading branch information
atticusofsparta authored and ppedziwiatr committed Nov 30, 2023
1 parent 4ee509c commit 81d305f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/contract/HandlerBasedContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,9 @@ export class HandlerBasedContract<State> implements Contract<State> {
let executionContext = await this.createExecutionContext(this._contractTxId, sortKey, true);

const currentBlockData =
this.warp.environment == 'mainnet' ? await this._arweaveWrapper.warpGwBlock() : await arweave.blocks.getCurrent();
this.warp.environment == 'mainnet' && !(this.warp.interactionsLoader.type() === 'arweave')
? await this._arweaveWrapper.warpGwBlock()
: await arweave.blocks.getCurrent();

// add caller info to execution context
let effectiveCaller;
Expand Down

0 comments on commit 81d305f

Please sign in to comment.