fix: commit intermediate states

This commit is contained in:
ppedziwiatr
2023-07-14 16:28:10 +02:00
committed by just_ppe
parent 96a696afaa
commit 014c933956

View File

@@ -69,9 +69,9 @@ export class ContractInteractionState implements InteractionState {
try { try {
const latestState = new Map<string, EvalStateResult<unknown>>(); const latestState = new Map<string, EvalStateResult<unknown>>();
this._json.forEach((val, k) => { this._json.forEach((val, k) => {
const state = val.get(interaction.sortKey); const state = this.getLessOrEqual(k, interaction.sortKey);
if (state != null) { if (state != null) {
latestState.set(k, state); latestState.set(k, state.cachedValue);
} }
}); });
await this.doStoreJson(latestState, interaction); await this.doStoreJson(latestState, interaction);