diff --git a/src/contract/states/ContractInteractionState.ts b/src/contract/states/ContractInteractionState.ts index 1615aca..0af3f40 100644 --- a/src/contract/states/ContractInteractionState.ts +++ b/src/contract/states/ContractInteractionState.ts @@ -69,9 +69,9 @@ export class ContractInteractionState implements InteractionState { try { const latestState = new Map>(); this._json.forEach((val, k) => { - const state = val.get(interaction.sortKey); + const state = this.getLessOrEqual(k, interaction.sortKey); if (state != null) { - latestState.set(k, state); + latestState.set(k, state.cachedValue); } }); await this.doStoreJson(latestState, interaction);