Skip to content

Commit

Permalink
fix: get event history
Browse files Browse the repository at this point in the history
  • Loading branch information
cauta committed May 20, 2024
1 parent 6118c7a commit b5e6774
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
) {}

Expand Down Expand Up @@ -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) =>
Expand Down Expand Up @@ -140,7 +142,7 @@ export class EventHistoryService {
}

if (monitor.network === MonitorNetwork.Mantle) {
return this.avaxEventHistoryRepository
return this.mantleEventHistoryRepository
.findEventHistoryByMonitorAndHash(
monitor.monitorId,
request.hash,
Expand Down Expand Up @@ -215,7 +217,7 @@ export class EventHistoryService {
}

if (monitor.network === MonitorNetwork.Mantle) {
return this.avaxEventHistoryRepository
return this.mantleEventHistoryRepository
.findEventHistoryByMonitorAndHash(
monitor.monitorId,
request.associatedAddress,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b5e6774

Please sign in to comment.