Skip to content

Commit ff81cfd

Browse files
f: rename _hashRCA*712
1 parent c1dc505 commit ff81cfd

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

packages/horizon/contracts/interfaces/IRecurringCollector.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,14 @@ interface IRecurringCollector is IAuthorizable, IPaymentsCollector {
317317
* @param rca The RCA for which to compute the hash.
318318
* @return The hash of the RCA.
319319
*/
320-
function hashRCA712(RecurringCollectionAgreement calldata rca) external view returns (bytes32);
320+
function hashRCA(RecurringCollectionAgreement calldata rca) external view returns (bytes32);
321321

322322
/**
323323
* @dev Computes the hash of a RecurringCollectionAgreementUpdate (RCAU).
324324
* @param rcau The RCAU for which to compute the hash.
325325
* @return The hash of the RCAU.
326326
*/
327-
function hashRCAU712(RecurringCollectionAgreementUpdate calldata rcau) external view returns (bytes32);
327+
function hashRCAU(RecurringCollectionAgreementUpdate calldata rcau) external view returns (bytes32);
328328

329329
/**
330330
* @dev Recovers the signer address of a signed RecurringCollectionAgreement (RCA).

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,17 @@ contract RecurringCollector is EIP712, GraphDirectory, Authorizable, IRecurringC
213213
}
214214

215215
/**
216-
* @notice See {IRecurringCollector.hashRCA712}
216+
* @notice See {IRecurringCollector.hashRCA}
217217
*/
218-
function hashRCA712(RecurringCollectionAgreement calldata rca) external view returns (bytes32) {
219-
return _hashRCA712(rca);
218+
function hashRCA(RecurringCollectionAgreement calldata rca) external view returns (bytes32) {
219+
return _hashRCA(rca);
220220
}
221221

222222
/**
223-
* @notice See {IRecurringCollector.hashRCAU712}
223+
* @notice See {IRecurringCollector.hashRCAU}
224224
*/
225-
function hashRCAU712(RecurringCollectionAgreementUpdate calldata rcau) external view returns (bytes32) {
226-
return _hashRCAU712(rcau);
225+
function hashRCAU(RecurringCollectionAgreementUpdate calldata rcau) external view returns (bytes32) {
226+
return _hashRCAU(rcau);
227227
}
228228

229229
/**
@@ -371,22 +371,22 @@ contract RecurringCollector is EIP712, GraphDirectory, Authorizable, IRecurringC
371371
* @notice See {IRecurringCollector.recoverRCASigner}
372372
*/
373373
function _recoverRCASigner(SignedRCA memory _signedRCA) private view returns (address) {
374-
bytes32 messageHash = _hashRCA712(_signedRCA.rca);
374+
bytes32 messageHash = _hashRCA(_signedRCA.rca);
375375
return ECDSA.recover(messageHash, _signedRCA.signature);
376376
}
377377

378378
/**
379379
* @notice See {IRecurringCollector.recoverRCAUSigner}
380380
*/
381381
function _recoverRCAUSigner(SignedRCAU memory _signedRCAU) private view returns (address) {
382-
bytes32 messageHash = _hashRCAU712(_signedRCAU.rcau);
382+
bytes32 messageHash = _hashRCAU(_signedRCAU.rcau);
383383
return ECDSA.recover(messageHash, _signedRCAU.signature);
384384
}
385385

386386
/**
387-
* @notice See {IRecurringCollector.hashRCA712}
387+
* @notice See {IRecurringCollector.hashRCA}
388388
*/
389-
function _hashRCA712(RecurringCollectionAgreement memory _rca) private view returns (bytes32) {
389+
function _hashRCA(RecurringCollectionAgreement memory _rca) private view returns (bytes32) {
390390
return
391391
_hashTypedDataV4(
392392
keccak256(
@@ -409,9 +409,9 @@ contract RecurringCollector is EIP712, GraphDirectory, Authorizable, IRecurringC
409409
}
410410

411411
/**
412-
* @notice See {IRecurringCollector.hashRCAU712}
412+
* @notice See {IRecurringCollector.hashRCAU}
413413
*/
414-
function _hashRCAU712(RecurringCollectionAgreementUpdate memory _rcau) private view returns (bytes32) {
414+
function _hashRCAU(RecurringCollectionAgreementUpdate memory _rcau) private view returns (bytes32) {
415415
return
416416
_hashTypedDataV4(
417417
keccak256(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ contract RecurringCollectorHelper is AuthorizableHelper, Bounder {
1919
IRecurringCollector.RecurringCollectionAgreement memory rca,
2020
uint256 signerPrivateKey
2121
) public view returns (IRecurringCollector.SignedRCA memory) {
22-
bytes32 messageHash = collector.hashRCA712(rca);
22+
bytes32 messageHash = collector.hashRCA(rca);
2323
(uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPrivateKey, messageHash);
2424
bytes memory signature = abi.encodePacked(r, s, v);
2525
IRecurringCollector.SignedRCA memory signedRCA = IRecurringCollector.SignedRCA({
@@ -34,7 +34,7 @@ contract RecurringCollectorHelper is AuthorizableHelper, Bounder {
3434
IRecurringCollector.RecurringCollectionAgreementUpdate memory rcau,
3535
uint256 signerPrivateKey
3636
) public view returns (IRecurringCollector.SignedRCAU memory) {
37-
bytes32 messageHash = collector.hashRCAU712(rcau);
37+
bytes32 messageHash = collector.hashRCAU(rcau);
3838
(uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPrivateKey, messageHash);
3939
bytes memory signature = abi.encodePacked(r, s, v);
4040
IRecurringCollector.SignedRCAU memory signedRCAU = IRecurringCollector.SignedRCAU({

0 commit comments

Comments
 (0)