Skip to content

Commit

Permalink
fixup! test: update tests to include active users counter
Browse files Browse the repository at this point in the history
Signed-off-by: Nadezhda Popova <[email protected]>
  • Loading branch information
nadezhdapopovaa committed Nov 12, 2024
1 parent 78144cb commit 10ef30b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/relay/tests/lib/eth/eth_call.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@ describe('@ethCall Eth Call spec', async function () {
});

it('should update execution counter and list the correct data when eth_call is executed', async function () {
const metrics = await registry.metrics();
await ethImpl.call(ETH_CALL_REQ_ARGS, 'latest', requestDetails);

const metrics = await registry.metrics();
const expectedMetricData = `rpc_relay_eth_executions{method="eth_call",function="${ETH_CALL_REQ_ARGS.data}",from="${ETH_CALL_REQ_ARGS.from}",to="${ETH_CALL_REQ_ARGS.to}"}`;

expect(ethImpl['ethExecutionsCounter']).to.be.instanceOf(Counter);
Expand Down
6 changes: 4 additions & 2 deletions packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { RequestDetails } from '../../../src/lib/types';
import MockAdapter from 'axios-mock-adapter';
import HAPIService from '../../../src/lib/services/hapiService/hapiService';
import { CacheService } from '../../../src/lib/services/cacheService/cacheService';
import { Registry } from 'prom-client';
import { Counter, Registry } from 'prom-client';

use(chaiAsPromised);

Expand Down Expand Up @@ -353,12 +353,14 @@ describe('@ethSendRawTransaction eth_sendRawTransaction spec', async function ()
});

it('should update execution counter and list the correct data when eth_sendRawTransation is executed', async function () {
const metrics = await registry.metrics();
const signed = await signTransaction(transaction);

await ethImpl.sendRawTransaction(signed, requestDetails);

const metrics = await registry.metrics();
const expectedMetricData = `rpc_relay_eth_executions{method="eth_sendRawTransaction",function="0x",from="${transaction.from}",to="${transaction.to}"}`;

expect(ethImpl['ethExecutionsCounter']).to.be.instanceOf(Counter);
assert.include(metrics, expectedMetricData);
});
});
Expand Down

0 comments on commit 10ef30b

Please sign in to comment.