diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..a03a1c53 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + "version": "1.0.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Jest: current file", + //"env": { "NODE_ENV": "test" }, + "program": "${workspaceFolder}/node_modules/.bin/jest", + "args": ["${fileBasenameNoExtension}", "--config", "jest.config.js"], + "console": "integratedTerminal", + "disableOptimisticBPs": true, + "windows": { + "program": "${workspaceFolder}/node_modules/jest/bin/jest" + } + } + ] +} diff --git a/src/core/modules/impl/DefaultStateEvaluator.ts b/src/core/modules/impl/DefaultStateEvaluator.ts index 29f0d662..91f27af3 100644 --- a/src/core/modules/impl/DefaultStateEvaluator.ts +++ b/src/core/modules/impl/DefaultStateEvaluator.ts @@ -317,8 +317,9 @@ export abstract class DefaultStateEvaluator implements StateEvaluator { } const forceStateStoreToCache = - executionContext.evaluationOptions.cacheEveryNInteractions > 0 && - i % executionContext.evaluationOptions.cacheEveryNInteractions === 0; + (executionContext.evaluationOptions.cacheEveryNInteractions > 0 && + i % executionContext.evaluationOptions.cacheEveryNInteractions === 0) || + missingInteractions.length == 1; // if that's the end of the root contract's interaction - commit all the uncommitted states to cache. if (contract.isRoot()) { contract.clearChildren();