Skip to content

Commit 6b5f5f9

Browse files
committed
Add tests
1 parent c24c723 commit 6b5f5f9

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

contracts/SpokePool.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ abstract contract SpokePool is
319319
/**
320320
* @notice Pauses deposit-related functions. This is intended to be used if this contract is deprecated or when
321321
* something goes awry.
322-
* @dev Affects `deposit()` but not `speedUpDeposit()`, so that existing deposits can be sped up and still
322+
* @dev Affects `deposit()` but not `speedUpV3Deposit()`, so that existing deposits can be sped up and still
323323
* relayed.
324324
* @param pause true if the call is meant to pause the system, false if the call is meant to unpause it.
325325
*/

test/evm/hardhat/SpokePool.Relay.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,23 @@ describe("SpokePool Relayer Logic", async function () {
413413
updatedMessage
414414
);
415415
});
416+
it("in absence of exclusivity", async function () {
417+
// Clock drift between spokes can mean exclusivityDeadline is in future even when no exclusivity was applied.
418+
await spokePool.setCurrentTime(relayData.exclusivityDeadline - 1);
419+
await expect(
420+
spokePool.connect(relayer).fillV3RelayWithUpdatedDeposit(
421+
{
422+
...relayData,
423+
exclusiveRelayer: consts.zeroAddress,
424+
},
425+
consts.repaymentChainId,
426+
updatedOutputAmount,
427+
updatedRecipient,
428+
updatedMessage,
429+
signature
430+
)
431+
).to.emit(spokePool, "FilledV3Relay");
432+
});
416433
it("must be exclusive relayer before exclusivity deadline", async function () {
417434
const _relayData = {
418435
...relayData,

test/evm/hardhat/SpokePool.SlowRelay.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ describe("SpokePool Slow Relay Logic", async function () {
5151
relayData.fillDeadline = (await spokePool.getCurrentTime()).sub(1);
5252
await expect(spokePool.connect(relayer).requestV3SlowFill(relayData)).to.be.revertedWith("ExpiredFillDeadline");
5353
});
54+
it("in absence of exclusivity", async function () {
55+
// Clock drift between spokes can mean exclusivityDeadline is in future even when no exclusivity was applied.
56+
await spokePool.setCurrentTime(relayData.exclusivityDeadline - 1);
57+
await expect(
58+
spokePool.connect(relayer).requestV3SlowFill({ ...relayData, exclusiveRelayer: consts.zeroAddress })
59+
).to.emit(spokePool, "RequestedV3SlowFill");
60+
});
5461
it("during exclusivity deadline", async function () {
5562
await spokePool.setCurrentTime(relayData.exclusivityDeadline);
5663
await expect(spokePool.connect(relayer).requestV3SlowFill(relayData)).to.be.revertedWith(

0 commit comments

Comments
 (0)