Skip to content

Commit b900097

Browse files
f: add now to RecurringCollectorAgreementDeadlineElapsed
1 parent bd49826 commit b900097

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

packages/horizon/contracts/interfaces/IRecurringCollector.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,10 @@ interface IRecurringCollector is IAuthorizable, IPaymentsCollector {
238238

239239
/**
240240
* Thrown when interacting with an agreement with an elapsed deadline
241+
* @param currentTimestamp The current timestamp
241242
* @param deadline The elapsed deadline timestamp
242243
*/
243-
error RecurringCollectorAgreementDeadlineElapsed(uint64 deadline);
244+
error RecurringCollectorAgreementDeadlineElapsed(uint256 currentTimestamp, uint64 deadline);
244245

245246
/**
246247
* Thrown when the signer is invalid

packages/horizon/contracts/payments/collectors/RecurringCollector.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ contract RecurringCollector is EIP712, GraphDirectory, Authorizable, IRecurringC
8383
);
8484
require(
8585
signedRCA.rca.deadline >= block.timestamp,
86-
RecurringCollectorAgreementDeadlineElapsed(signedRCA.rca.deadline)
86+
RecurringCollectorAgreementDeadlineElapsed(block.timestamp, signedRCA.rca.deadline)
8787
);
8888

8989
// check that the voucher is signed by the payer (or proxy)
@@ -175,7 +175,7 @@ contract RecurringCollector is EIP712, GraphDirectory, Authorizable, IRecurringC
175175
function update(SignedRCAU calldata signedRCAU) external {
176176
require(
177177
signedRCAU.rcau.deadline >= block.timestamp,
178-
RecurringCollectorAgreementDeadlineElapsed(signedRCAU.rcau.deadline)
178+
RecurringCollectorAgreementDeadlineElapsed(block.timestamp, signedRCAU.rcau.deadline)
179179
);
180180

181181
AgreementData storage agreement = _getAgreementStorage(signedRCAU.rcau.agreementId);

packages/horizon/test/unit/payments/recurring-collector/accept.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ contract RecurringCollectorAcceptTest is RecurringCollectorSharedTest {
2626

2727
bytes memory expectedErr = abi.encodeWithSelector(
2828
IRecurringCollector.RecurringCollectorAgreementDeadlineElapsed.selector,
29+
block.timestamp,
2930
fuzzySignedRCA.rca.deadline
3031
);
3132
vm.expectRevert(expectedErr);

packages/horizon/test/unit/payments/recurring-collector/update.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ contract RecurringCollectorUpdateTest is RecurringCollectorSharedTest {
3030

3131
bytes memory expectedErr = abi.encodeWithSelector(
3232
IRecurringCollector.RecurringCollectorAgreementDeadlineElapsed.selector,
33+
block.timestamp,
3334
rcau.deadline
3435
);
3536
vm.expectRevert(expectedErr);

0 commit comments

Comments
 (0)