From b5e67744134c4e846ee21c422d2ea194c359d75b Mon Sep 17 00:00:00 2001 From: cauta Date: Mon, 20 May 2024 15:01:03 +0700 Subject: [PATCH] fix: get event history --- .../src/modules/event_history/event_history.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/apps/onebox/src/modules/event_history/event_history.service.ts b/app/apps/onebox/src/modules/event_history/event_history.service.ts index b88486e..1273332 100644 --- a/app/apps/onebox/src/modules/event_history/event_history.service.ts +++ b/app/apps/onebox/src/modules/event_history/event_history.service.ts @@ -2,6 +2,7 @@ import { ErrorCode } from '@app/global/global.error'; import { AvaxEventHistoryRepository, EthEventHistoryRepository, + MantleEventHistoryRepository, PolygonEventHistoryRepository, } from '@app/shared_modules/event_history/repositories/event_history.repository'; import { MonitorNetwork } from '@app/shared_modules/monitor/schemas/monitor.schema'; @@ -23,6 +24,7 @@ export class EventHistoryService { private readonly ethEventHistoryRepository: EthEventHistoryRepository, private readonly polygonEventHistoryRepository: PolygonEventHistoryRepository, private readonly avaxEventHistoryRepository: AvaxEventHistoryRepository, + private readonly mantleEventHistoryRepository: MantleEventHistoryRepository, private readonly monitorService: MonitorService, ) {} @@ -70,7 +72,7 @@ export class EventHistoryService { } if (monitor.network === MonitorNetwork.Mantle) { - return this.avaxEventHistoryRepository + return this.mantleEventHistoryRepository .getEventHistory(monitor.monitorId, request.limit, request.offset) .then((response) => { return response.map((event) => @@ -140,7 +142,7 @@ export class EventHistoryService { } if (monitor.network === MonitorNetwork.Mantle) { - return this.avaxEventHistoryRepository + return this.mantleEventHistoryRepository .findEventHistoryByMonitorAndHash( monitor.monitorId, request.hash, @@ -215,7 +217,7 @@ export class EventHistoryService { } if (monitor.network === MonitorNetwork.Mantle) { - return this.avaxEventHistoryRepository + return this.mantleEventHistoryRepository .findEventHistoryByMonitorAndHash( monitor.monitorId, request.associatedAddress, @@ -269,7 +271,7 @@ export class EventHistoryService { } if (monitor.network === MonitorNetwork.Mantle) { - return this.avaxEventHistoryRepository + return this.mantleEventHistoryRepository .findByEventId(request.eventId) .then((response) => { return MonitorEventHistoryResponseDto.from(response);