Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cbv2): checksum address #333

Merged
merged 2 commits into from
Jun 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/cron/fade-rate-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ScheduledHandler } from 'aws-lambda/trigger/cloudwatch-events';
import { EventBridgeEvent } from 'aws-lambda/trigger/eventbridge';
import Logger from 'bunyan';

import { ethers } from 'ethers';
import { BETA_S3_KEY, PRODUCTION_S3_KEY, WEBHOOK_CONFIG_BUCKET } from '../constants';
import { CircuitBreakerMetricDimension } from '../entities';
import { checkDefined } from '../preconditions/preconditions';
Expand Down Expand Up @@ -67,7 +68,10 @@ async function main(metrics: MetricsLogger) {
if (result) {
const fillerEndpoints = webhookProvider.fillerEndpoints();
const addressToFillerMap = await fillerAddressRepo.getAddressToFillerMap(fillerEndpoints);
log.info({ addressToFillerMap }, 'address to filler map from dynamo');
log.info(
ConjunctiveNormalForm marked this conversation as resolved.
Show resolved Hide resolved
{ map: addressToFillerMap.forEach((filler, addr) => [addr, filler]) },
'address to filler map from dynamo'
);
const fillerTimestamps = await timestampDB.getFillerTimestampsMap(fillerEndpoints);

// get fillers new fades from last checked timestamp:
Expand Down Expand Up @@ -134,7 +138,7 @@ export function getFillersNewFades(
): FillerFades {
const newFadesMap: FillerFades = {}; // filler hash -> # of new fades
rows.forEach((row) => {
const fillerAddr = row.fillerAddress.toLowerCase();
const fillerAddr = ethers.utils.getAddress(row.fillerAddress);
const fillerHash = addressToFillerMap.get(fillerAddr);
if (!fillerHash) {
log?.info({ fillerAddr }, 'filler address not found dynamo mapping');
Expand Down
Loading