Skip to content

Commit fee01d9

Browse files
committed
make getV3RelayHash public
Signed-off-by: bennett <[email protected]>
1 parent f3ea9f8 commit fee01d9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

contracts/SpokePool.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ abstract contract SpokePool is
10111011

10121012
V3RelayExecutionParams memory relayExecution = V3RelayExecutionParams({
10131013
relay: relayData,
1014-
relayHash: _getV3RelayHash(relayData),
1014+
relayHash: getV3RelayHash(relayData),
10151015
updatedOutputAmount: relayData.outputAmount,
10161016
updatedRecipient: relayData.recipient,
10171017
updatedMessage: relayData.message,
@@ -1059,7 +1059,7 @@ abstract contract SpokePool is
10591059

10601060
V3RelayExecutionParams memory relayExecution = V3RelayExecutionParams({
10611061
relay: relayData,
1062-
relayHash: _getV3RelayHash(relayData),
1062+
relayHash: getV3RelayHash(relayData),
10631063
updatedOutputAmount: updatedOutputAmount,
10641064
updatedRecipient: updatedRecipient,
10651065
updatedMessage: updatedMessage,
@@ -1106,7 +1106,7 @@ abstract contract SpokePool is
11061106
}
11071107
if (relayData.fillDeadline < currentTime) revert ExpiredFillDeadline();
11081108

1109-
bytes32 relayHash = _getV3RelayHash(relayData);
1109+
bytes32 relayHash = getV3RelayHash(relayData);
11101110
if (fillStatuses[relayHash] != uint256(FillStatus.Unfilled)) revert InvalidSlowFillRequest();
11111111
fillStatuses[relayHash] = uint256(FillStatus.RequestedSlowFill);
11121112

@@ -1195,7 +1195,7 @@ abstract contract SpokePool is
11951195
// deposit params like outputAmount, message and recipient.
11961196
V3RelayExecutionParams memory relayExecution = V3RelayExecutionParams({
11971197
relay: relayData,
1198-
relayHash: _getV3RelayHash(relayData),
1198+
relayHash: getV3RelayHash(relayData),
11991199
updatedOutputAmount: slowFillLeaf.updatedOutputAmount,
12001200
updatedRecipient: relayData.recipient,
12011201
updatedMessage: relayData.message,
@@ -1315,6 +1315,10 @@ abstract contract SpokePool is
13151315
return relayerRefund[l2TokenAddress][refundAddress];
13161316
}
13171317

1318+
function getV3RelayHash(V3RelayData memory relayData) public view returns (bytes32) {
1319+
return keccak256(abi.encode(relayData, chainId()));
1320+
}
1321+
13181322
/**************************************
13191323
* INTERNAL FUNCTIONS *
13201324
**************************************/
@@ -1640,10 +1644,6 @@ abstract contract SpokePool is
16401644
return (amount * uint256(int256(1e18) - feesPct)) / 1e18;
16411645
}
16421646

1643-
function _getV3RelayHash(V3RelayData memory relayData) private view returns (bytes32) {
1644-
return keccak256(abi.encode(relayData, chainId()));
1645-
}
1646-
16471647
// Unwraps ETH and does a transfer to a recipient address. If the recipient is a smart contract then sends wrappedNativeToken.
16481648
function _unwrapwrappedNativeTokenTo(address payable to, uint256 amount) internal {
16491649
if (address(to).isContract()) {

0 commit comments

Comments
 (0)