diff --git a/package.json b/package.json index 471c1bf3..4ce0f6a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "warp-contracts", - "version": "1.4.34", + "version": "1.4.34-beta.1", "description": "An implementation of the SmartWeave smart contract protocol.", "types": "./lib/types/index.d.ts", "main": "./lib/cjs/index.js", diff --git a/src/contract/HandlerBasedContract.ts b/src/contract/HandlerBasedContract.ts index e6aa064f..ed2c2947 100644 --- a/src/contract/HandlerBasedContract.ts +++ b/src/contract/HandlerBasedContract.ts @@ -646,13 +646,11 @@ export class HandlerBasedContract implements Contract { const benchmark = Benchmark.measure(); if (!this.isRoot()) { - cachedState = - state || - (this.interactionState().getLessOrEqual(this.txId(), upToSortKey) as SortKeyCacheResult< - EvalStateResult - >); + cachedState = this.interactionState().getLessOrEqual(this.txId(), upToSortKey) as SortKeyCacheResult< + EvalStateResult + >; } - cachedState = cachedState || (await stateEvaluator.latestAvailableState(contractTxId, upToSortKey)); + cachedState = state || cachedState || (await stateEvaluator.latestAvailableState(contractTxId, upToSortKey)); if (upToSortKey && this.evaluationOptions().strictSortKey && cachedState?.sortKey != upToSortKey) { throw new Error(`State not cached at the exact required ${upToSortKey} sortKey`); }