Skip to content

Commit 4750ac7

Browse files
committed
feat: move measurements to dedicated decorator test fixed (hiero-ledger#4558)
Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
1 parent 653fef8 commit 4750ac7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/relay/tests/lib/services/cacheService/cacheService.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ describe('CacheService Test Suite', async function () {
238238

239239
describe('should not initialize redis cache if shared cache is not enabled', async function () {
240240
it('should not initialize redis cache if shared cache is not enabled', async function () {
241-
expect(cacheService).to.be.an.instanceOf(LocalLRUCache);
241+
expect(cacheService['decorated']).to.be.an.instanceOf(LocalLRUCache);
242242
});
243243
});
244244
});

packages/server/tests/integration/server.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { predefined, Relay } from '@hashgraph/json-rpc-relay';
88
import { MirrorNodeClient } from '@hashgraph/json-rpc-relay/dist/lib/clients';
99
import { TracerType } from '@hashgraph/json-rpc-relay/dist/lib/constants';
1010
import { DebugImpl } from '@hashgraph/json-rpc-relay/dist/lib/debug';
11-
import { CacheService } from '@hashgraph/json-rpc-relay/dist/lib/services/cacheService/cacheService';
1211
import { Constants, TYPES } from '@hashgraph/json-rpc-relay/dist/lib/validators';
1312

1413
import serverTestConstants from '../helpers/constants';
@@ -24,6 +23,8 @@ import { GCProfiler } from 'v8';
2423

2524
chai.use(chaiAsPromised);
2625

26+
import { MeasurableCache } from '@hashgraph/json-rpc-relay/dist/lib/clients/cache/measurableCache';
27+
2728
import {
2829
contractAddress1,
2930
contractAddress2,
@@ -3037,8 +3038,8 @@ describe('RPC Server', function () {
30373038
});
30383039
callTracer = sinon.stub(DebugImpl.prototype, 'callTracer').resolves(callTracerResult);
30393040
prestateTracer = sinon.stub(DebugImpl.prototype, 'prestateTracer').resolves(prestateTracerResult);
3040-
cacheGetAsync = sinon.stub(CacheService.prototype, 'getAsync').resolves(null);
3041-
cacheSet = sinon.stub(CacheService.prototype, 'set').resolves();
3041+
cacheGetAsync = sinon.stub(MeasurableCache.prototype, 'getAsync').resolves(null);
3042+
cacheSet = sinon.stub(MeasurableCache.prototype, 'set').resolves();
30423043
requireDebugAPIEnabled = sinon.stub(DebugImpl, 'requireDebugAPIEnabled').returns();
30433044
});
30443045

@@ -3169,7 +3170,7 @@ describe('RPC Server', function () {
31693170
expect(response.data.result).to.have.lengthOf(2);
31703171
});
31713172

3172-
it('should return cached result if available', async () => {
3173+
it.only('should return cached result if available', async () => {
31733174
const cachedResult = [{ txHash: '0xabcd1234', result: callTracerResult }];
31743175
cacheGetAsync.resolves(cachedResult);
31753176

0 commit comments

Comments
 (0)