From f4759d33c1bd8f6cd28caf66beff80d19d8dd3f2 Mon Sep 17 00:00:00 2001 From: ConjunctiveNormalForm Date: Tue, 4 Jun 2024 14:30:16 -0400 Subject: [PATCH] use filler endpoint instead of hashes --- lib/cron/fade-rate-v2.ts | 6 +++--- lib/providers/webhook/s3.ts | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/cron/fade-rate-v2.ts b/lib/cron/fade-rate-v2.ts index 8000e55b..6aea1e09 100644 --- a/lib/cron/fade-rate-v2.ts +++ b/lib/cron/fade-rate-v2.ts @@ -65,10 +65,10 @@ async function main(metrics: MetricsLogger) { const result = await fadesRepository.getFades(); if (result) { - const fillerHashes = webhookProvider.fillers(); - const addressToFillerMap = await fillerAddressRepo.getAddressToFillerMap(fillerHashes); + const fillerEndpoints = webhookProvider.fillerEndpoints(); + const addressToFillerMap = await fillerAddressRepo.getAddressToFillerMap(fillerEndpoints); log.info({ addressToFillerMap }, 'address to filler map from dynamo'); - const fillerTimestamps = await timestampDB.getFillerTimestampsMap(fillerHashes); + const fillerTimestamps = await timestampDB.getFillerTimestampsMap(fillerEndpoints); // get fillers new fades from last checked timestamp: // | hash | faded | postTimestamp | diff --git a/lib/providers/webhook/s3.ts b/lib/providers/webhook/s3.ts index 053be138..36ff8f36 100644 --- a/lib/providers/webhook/s3.ts +++ b/lib/providers/webhook/s3.ts @@ -25,6 +25,10 @@ export class S3WebhookConfigurationProvider implements WebhookConfigurationProvi return [...new Set(this.endpoints.map((endpoint) => endpoint.hash))]; } + fillerEndpoints(): string[] { + return this.endpoints.map((endpoint) => endpoint.endpoint); + } + async addressToFillerHash(): Promise> { const map = new Map(); if (this.endpoints.length === 0) {