Skip to content

Commit

Permalink
Drop populateRelay
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Feb 28, 2025
1 parent ea8c429 commit d1aaee9
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/utils/SpokeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,6 @@ import { toBytes32 } from "./AddressUtils";

type BlockTag = providers.BlockTag;

/**
* @param spokePool SpokePool Contract instance.
* @param deposit Deopsit instance.
* @param repaymentChainId Optional repaymentChainId (defaults to destinationChainId).
* @returns An Ethers UnsignedTransaction instance.
*/
export function populateRelay(
spokePool: Contract,
deposit: Omit<Deposit, "messageHash">,
relayer: string,
repaymentChainId = deposit.destinationChainId
): Promise<PopulatedTransaction> {
const RelayData = {
depositor: toBytes32(deposit.depositor),
recipient: toBytes32(deposit.recipient),
exclusiveRelayer: toBytes32(deposit.exclusiveRelayer),
inputToken: toBytes32(deposit.inputToken),
outputToken: toBytes32(deposit.outputToken),
inputAmount: deposit.inputAmount,
outputAmount: deposit.outputAmount,
originChainId: deposit.originChainId,
depositId: deposit.depositId,
fillDeadline: deposit.fillDeadline,
exclusivityDeadline: deposit.exclusivityDeadline,
message: deposit.message,
};
if (isDefined(deposit.speedUpSignature)) {
assert(isDefined(deposit.updatedRecipient) && !isZeroAddress(deposit.updatedRecipient));
assert(isDefined(deposit.updatedOutputAmount));
assert(isDefined(deposit.updatedMessage));
return spokePool.populateTransaction.fillRelayWithUpdatedDeposit(
RelayData,
repaymentChainId,
toBytes32(relayer),
deposit.updatedOutputAmount,
toBytes32(deposit.updatedRecipient),
deposit.updatedMessage,
deposit.speedUpSignature,
{ from: relayer }
);
}

return spokePool.populateTransaction.fillRelay(RelayData, repaymentChainId, toBytes32(relayer), { from: relayer });
}

/**
* @param spokePool SpokePool Contract instance.
* @param deposit V3Deopsit instance.
Expand Down

0 comments on commit d1aaee9

Please sign in to comment.