Skip to content

Commit 460e9ab

Browse files
authored
refactor(BundleDataClient): Remove unused function and test (#971)
1 parent ad52cf2 commit 460e9ab

File tree

2 files changed

+0
-159
lines changed

2 files changed

+0
-159
lines changed

src/clients/BundleDataClient/BundleDataClient.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
forEachAsync,
3333
getBlockRangeForChain,
3434
getImpliedBundleBlockRanges,
35-
getMessageHash,
3635
getRelayEventKey,
3736
isSlowFill,
3837
mapAsync,
@@ -45,7 +44,6 @@ import {
4544
} from "../../utils";
4645
import winston from "winston";
4746
import {
48-
BundleData,
4947
BundleDataSS,
5048
getEndBlockBuffers,
5149
getRefundInformationFromFill,
@@ -57,7 +55,6 @@ import {
5755
V3FillWithBlock,
5856
verifyFillRepayment,
5957
} from "./utils";
60-
import { UNDEFINED_MESSAGE_HASH } from "../../constants";
6158
import { isEVMSpokePoolClient } from "../SpokePoolClient";
6259

6360
// max(uint256) - 1
@@ -209,37 +206,6 @@ export class BundleDataClient {
209206
return `bundles-${BundleDataClient.getArweaveClientKey(blockRangesForChains)}`;
210207
}
211208

212-
// Post-populate any missing message hashes.
213-
// @todo This can be removed once the legacy types hurdle is cleared (earliest 7 days post migration).
214-
backfillMessageHashes(data: Pick<BundleData, "bundleDepositsV3" | "bundleFillsV3">): void {
215-
Object.values(data.bundleDepositsV3).forEach((x) =>
216-
Object.values(x).forEach((deposits) =>
217-
deposits.forEach((deposit) => {
218-
if (deposit.messageHash === UNDEFINED_MESSAGE_HASH) {
219-
deposit.messageHash = getMessageHash(deposit.message);
220-
}
221-
})
222-
)
223-
);
224-
225-
Object.values(data.bundleFillsV3).forEach((x) =>
226-
Object.values(x).forEach(({ fills }) =>
227-
fills.forEach((fill) => {
228-
if (fill.messageHash === UNDEFINED_MESSAGE_HASH && isDefined(fill.message)) {
229-
// If messageHash is undefined, fill should be of type FilledV3Relay and should have a message.
230-
fill.messageHash = getMessageHash(fill.message);
231-
}
232-
if (
233-
fill.relayExecutionInfo.updatedMessageHash === UNDEFINED_MESSAGE_HASH &&
234-
isDefined(fill.relayExecutionInfo.updatedMessage)
235-
) {
236-
fill.relayExecutionInfo.updatedMessageHash = getMessageHash(fill.relayExecutionInfo.updatedMessage);
237-
}
238-
})
239-
)
240-
);
241-
}
242-
243209
private async loadPersistedDataFromArweave(
244210
blockRangesForChains: number[][]
245211
): Promise<LoadDataReturnValue | undefined> {
@@ -271,9 +237,6 @@ export class BundleDataClient {
271237
);
272238

273239
const data = persistedData[0].data;
274-
275-
this.backfillMessageHashes(data);
276-
277240
const bundleData = {
278241
bundleFillsV3: convertTypedStringRecordIntoNumericRecord(data.bundleFillsV3),
279242
expiredDepositsToRefundV3: convertTypedStringRecordIntoNumericRecord(data.expiredDepositsToRefundV3),

test/BundleDataClient.ts

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)