Skip to content

refactor(BundleDataClient): Remove unused function and test #971

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

Merged
merged 1 commit into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
37 changes: 0 additions & 37 deletions src/clients/BundleDataClient/BundleDataClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
forEachAsync,
getBlockRangeForChain,
getImpliedBundleBlockRanges,
getMessageHash,
getRelayEventKey,
isSlowFill,
mapAsync,
Expand All @@ -45,7 +44,6 @@ import {
} from "../../utils";
import winston from "winston";
import {
BundleData,
BundleDataSS,
getEndBlockBuffers,
getRefundInformationFromFill,
Expand All @@ -57,7 +55,6 @@ import {
V3FillWithBlock,
verifyFillRepayment,
} from "./utils";
import { UNDEFINED_MESSAGE_HASH } from "../../constants";
import { isEVMSpokePoolClient } from "../SpokePoolClient";

// max(uint256) - 1
Expand Down Expand Up @@ -209,37 +206,6 @@ export class BundleDataClient {
return `bundles-${BundleDataClient.getArweaveClientKey(blockRangesForChains)}`;
}

// Post-populate any missing message hashes.
// @todo This can be removed once the legacy types hurdle is cleared (earliest 7 days post migration).
backfillMessageHashes(data: Pick<BundleData, "bundleDepositsV3" | "bundleFillsV3">): void {
Object.values(data.bundleDepositsV3).forEach((x) =>
Object.values(x).forEach((deposits) =>
deposits.forEach((deposit) => {
if (deposit.messageHash === UNDEFINED_MESSAGE_HASH) {
deposit.messageHash = getMessageHash(deposit.message);
}
})
)
);

Object.values(data.bundleFillsV3).forEach((x) =>
Object.values(x).forEach(({ fills }) =>
fills.forEach((fill) => {
if (fill.messageHash === UNDEFINED_MESSAGE_HASH && isDefined(fill.message)) {
// If messageHash is undefined, fill should be of type FilledV3Relay and should have a message.
fill.messageHash = getMessageHash(fill.message);
}
if (
fill.relayExecutionInfo.updatedMessageHash === UNDEFINED_MESSAGE_HASH &&
isDefined(fill.relayExecutionInfo.updatedMessage)
) {
fill.relayExecutionInfo.updatedMessageHash = getMessageHash(fill.relayExecutionInfo.updatedMessage);
}
})
)
);
}

private async loadPersistedDataFromArweave(
blockRangesForChains: number[][]
): Promise<LoadDataReturnValue | undefined> {
Expand Down Expand Up @@ -271,9 +237,6 @@ export class BundleDataClient {
);

const data = persistedData[0].data;

this.backfillMessageHashes(data);

const bundleData = {
bundleFillsV3: convertTypedStringRecordIntoNumericRecord(data.bundleFillsV3),
expiredDepositsToRefundV3: convertTypedStringRecordIntoNumericRecord(data.expiredDepositsToRefundV3),
Expand Down
122 changes: 0 additions & 122 deletions test/BundleDataClient.ts

This file was deleted.