Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pxrl/testCleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Feb 12, 2024
2 parents afbc4cf + 713f993 commit f6e4de8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 41 deletions.
12 changes: 6 additions & 6 deletions src/clients/mocks/MockSpokePoolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,11 @@ export class MockSpokePoolClient extends SpokePoolClient {
depositor: fill.depositor ?? randomAddress(),
recipient,
message,
updatableRelayData: {
updatedRecipient: fill.updatableRelayData?.recipient ?? recipient,
updatedMessage: fill.updatableRelayData?.message ?? message,
updatedOutputAmount: fill.updatableRelayData?.outputAmount ?? outputAmount,
fillType: fill.updatableRelayData?.fillType ?? FillType.FastFill,
relayExecutionInfo: {
updatedRecipient: fill.relayExecutionInfo?.recipient ?? recipient,
updatedMessage: fill.relayExecutionInfo?.message ?? message,
updatedOutputAmount: fill.relayExecutionInfo?.outputAmount ?? outputAmount,
fillType: fill.relayExecutionInfo?.fillType ?? FillType.FastFill,
},
};

Expand Down Expand Up @@ -392,7 +392,7 @@ export class MockSpokePoolClient extends SpokePoolClient {
destinationChainId: this.chainId,
relayer: ZERO_ADDRESS,
repaymentChainId: 0,
updatableRelayData: {
relayExecutionInfo: {
recipient: leaf.relayData.recipient,
outputAmount: leaf.updatedOutputAmount,
message: leaf.relayData.message,
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/SpokePool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export interface V3Fill extends V3RelayData {
destinationChainId: number;
relayer: string;
repaymentChainId: number;
updatableRelayData: V3RelayExecutionEventInfo;
relayExecutionInfo: V3RelayExecutionEventInfo;
}

export interface V2FillWithBlock extends V2Fill, SortableEvent {}
Expand Down
27 changes: 0 additions & 27 deletions src/interfaces/UBA.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export * from "./ConfigStore";
export * from "./HubPool";
export * from "./SpokePool";
export * from "./Bridge";
export * from "./UBA";
export * from "./Error";
export * from "./TypedData";
export * from "./CachingMechanism";
2 changes: 1 addition & 1 deletion src/utils/V3Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function isV3RelayData<T extends MinV3RelayData, U extends MinV2RelayData
}

export function isSlowFill(fill: Fill): boolean {
return isV2Fill(fill) ? fill.updatableRelayData.isSlowRelay : fill.updatableRelayData.fillType === FillType.SlowFill;
return isV2Fill(fill) ? fill.updatableRelayData.isSlowRelay : fill.relayExecutionInfo.fillType === FillType.SlowFill;
}

type MinV2SlowFillLeaf = Pick<V2SlowFillLeaf, "payoutAdjustmentPct">;
Expand Down
2 changes: 1 addition & 1 deletion test/utils/SpokePoolUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function v3FillFromDeposit(deposit: V3DepositWithBlock, relayer: string):
// Caller can modify these later.
exclusiveRelayer: relayer,
repaymentChainId: deposit.destinationChainId,
updatableRelayData: {
relayExecutionInfo: {
recipient: deposit.updatedRecipient ?? recipient,
message: deposit.updatedMessage ?? message,
outputAmount: deposit.updatedOutputAmount ?? deposit.outputAmount,
Expand Down
12 changes: 8 additions & 4 deletions test/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,16 @@ export async function setupTokensForWallet(
weth?: utils.Contract,
seedMultiplier = 1
): Promise<void> {
const approveToken = async (token: Contract) => {
const balance = await token.balanceOf(wallet.address);
await token.connect(wallet).approve(contractToApprove.address, balance);
};

await utils.seedWallet(wallet, tokens, weth, utils.amountToSeedWallets.mul(seedMultiplier));
await Promise.all(
tokens.map((token) => token.connect(wallet).approve(contractToApprove.address, amountToDeposit.mul(seedMultiplier)))
);
await Promise.all(tokens.map(approveToken));

if (weth) {
await weth.connect(wallet).approve(contractToApprove.address, amountToDeposit);
await approveToken(weth);
}
}

Expand Down

0 comments on commit f6e4de8

Please sign in to comment.