@@ -322,15 +322,9 @@ describe('Metric Service', function () {
322322
323323 describe ( 'ethExecutionsCounter' , ( ) => {
324324 const mockedMethod = 'eth_sendRawTransaction' ;
325- const mockedFunctionSelector = '0x12345678' ;
326- const mockedFrom = '0x1234567890123456789012345678901234567890' ;
327- const mockedTo = '0x0987654321098765432109876543210987654321' ;
328325
329326 const mockedEthExecutionEventPayload = {
330327 method : mockedMethod ,
331- functionSelector : mockedFunctionSelector ,
332- from : mockedFrom ,
333- to : mockedTo ,
334328 requestDetails,
335329 } ;
336330
@@ -339,28 +333,15 @@ describe('Metric Service', function () {
339333 const counterBefore = await metricService [ 'ethExecutionsCounter' ] . get ( ) ;
340334
341335 // Find the initial value for our specific labels, or use 0 if not found
342- const initialValue =
343- counterBefore . values . find (
344- ( metric ) =>
345- metric . labels . method === mockedMethod &&
346- metric . labels . function === mockedFunctionSelector &&
347- metric . labels . from === mockedFrom &&
348- metric . labels . to === mockedTo ,
349- ) ?. value || 0 ;
336+ const initialValue = counterBefore . values . find ( ( metric ) => metric . labels . method === mockedMethod ) ?. value || 0 ;
350337
351338 eventEmitter . emit ( constants . EVENTS . ETH_EXECUTION , mockedEthExecutionEventPayload ) ;
352339
353340 // Get the counter after emitting the event
354341 const counterAfter = await metricService [ 'ethExecutionsCounter' ] . get ( ) ;
355342
356343 // Find the value for our specific labels after the event
357- const metricValue = counterAfter . values . find (
358- ( metric ) =>
359- metric . labels . method === mockedMethod &&
360- metric . labels . function === mockedFunctionSelector &&
361- metric . labels . from === mockedFrom &&
362- metric . labels . to === mockedTo ,
363- ) ?. value ;
344+ const metricValue = counterAfter . values . find ( ( metric ) => metric . labels . method === mockedMethod ) ?. value ;
364345
365346 expect ( metricValue ) . to . eq ( initialValue + 1 ) ;
366347 } ) ;
0 commit comments