From df94d5cd0aad20a65f5dbbfe04b8b23b7cba190c Mon Sep 17 00:00:00 2001 From: Asia Date: Tue, 13 Aug 2024 10:05:53 +0200 Subject: [PATCH] v1.4.36-beta.10 --- package.json | 2 +- src/contract/states/ContractInteractionState.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index cf8172f8..677651fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "warp-contracts", - "version": "1.4.36-beta.9", + "version": "1.4.36-beta.10", "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/states/ContractInteractionState.ts b/src/contract/states/ContractInteractionState.ts index ac84c72a..47d5d8cd 100644 --- a/src/contract/states/ContractInteractionState.ts +++ b/src/contract/states/ContractInteractionState.ts @@ -81,9 +81,7 @@ export class ContractInteractionState implements InteractionState { } }); const doStoreJsonBenchmark = Benchmark.measure(); - this.doStoreJson(latestState, interaction, forceStore).then(() => { - this.logger.info(`json stored`); - }); + await this.doStoreJson(latestState, interaction, forceStore); doStoreJsonBenchmark.stop(); this.logger.info('doStoreJsonBenchmark', doStoreJsonBenchmark.elapsed()); const commitKvsBenchmark = Benchmark.measure(); @@ -102,7 +100,7 @@ export class ContractInteractionState implements InteractionState { async rollback(interaction: GQLNodeInterface, forceStateStoreToCache: boolean): Promise { try { - this.doStoreJson(this._initialJson, interaction, forceStateStoreToCache).then(); + await this.doStoreJson(this._initialJson, interaction, forceStateStoreToCache); await this.rollbackKVs(); } finally { this.reset(); @@ -150,7 +148,7 @@ export class ContractInteractionState implements InteractionState { ) { if (states.size > 1 || forceStore) { for (const [k, v] of states) { - await this._warp.stateEvaluator.putInCache(k, interaction, v); + this._warp.stateEvaluator.putInCache(k, interaction, v).then(); } } }