Skip to content

Commit

Permalink
v1.4.36-beta.6
Browse files Browse the repository at this point in the history
  • Loading branch information
asiaziola committed Aug 12, 2024
1 parent 79c1cf3 commit fc19416
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "warp-contracts",
"version": "1.4.36-beta.5",
"version": "1.4.36-beta.6",
"description": "An implementation of the SmartWeave smart contract protocol.",
"types": "./lib/types/index.d.ts",
"main": "./lib/cjs/index.js",
Expand Down
11 changes: 10 additions & 1 deletion src/contract/states/ContractInteractionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import { GQLNodeInterface } from '../../legacy/gqlResult';
import { Warp } from '../../core/Warp';
import { SortKeyCacheRangeOptions } from '../../cache/SortKeyCacheRangeOptions';
import { SimpleLRUCache } from '../../common/SimpleLRUCache';
import { Benchmark } from '../../logging/Benchmark';
import { LoggerFactory } from '../../logging/LoggerFactory';

export class ContractInteractionState implements InteractionState {
private readonly _json = new Map<string, SimpleLRUCache<string, EvalStateResult<unknown>>>();
private readonly _initialJson = new Map<string, EvalStateResult<unknown>>();
private readonly _kv = new Map<string, SortKeyCache<unknown>>();
private readonly logger = LoggerFactory.INST.create('ContractInteractionState');

constructor(private readonly _warp: Warp) {}

Expand Down Expand Up @@ -77,8 +80,14 @@ export class ContractInteractionState implements InteractionState {
latestState.set(k, state.cachedValue);
}
});
this.doStoreJson(latestState, interaction, forceStore).then();
const doStoreJsonBenchmark = Benchmark.measure();
await this.doStoreJson(latestState, interaction, forceStore);
doStoreJsonBenchmark.stop();
this.logger.info('doStoreJsonBenchmark', doStoreJsonBenchmark.elapsed());
const commitKvsBenchmark = Benchmark.measure();
await this.commitKVs();
commitKvsBenchmark.stop();
this.logger.info('commitKvs', doStoreJsonBenchmark.elapsed());
} finally {
this.reset();
}
Expand Down

0 comments on commit fc19416

Please sign in to comment.