Skip to content

Commit 90978a9

Browse files
committed
chore: revert adding collector address to RAV
Signed-off-by: Tomás Migone <[email protected]>
1 parent 9b79fdb commit 90978a9

File tree

3 files changed

+1
-40
lines changed

3 files changed

+1
-40
lines changed

packages/horizon/contracts/interfaces/ITAPCollector.sol

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ interface ITAPCollector is IPaymentsCollector {
2929
bytes32 collectionId;
3030
// The address of the payer the RAV was issued by
3131
address payer;
32-
// The address of the collector where the RAV can be collected
33-
address collector;
3432
// The address of the service provider the RAV was issued to
3533
address serviceProvider;
3634
// The address of the data service the RAV was issued to
@@ -104,13 +102,6 @@ interface ITAPCollector is IPaymentsCollector {
104102
bytes signature
105103
);
106104

107-
/**
108-
* Thrown when attempting to collect a RAV that was not issued to this collector
109-
* @param collector The address of this collector processing the RAV
110-
* @param ravCollector The collector address noted in the RAV
111-
*/
112-
error TAPCollectorInvalidCollector(address collector, address ravCollector);
113-
114105
/**
115106
* Thrown when the signer is already authorized
116107
* @param authorizingPayer The address of the payer authorizing the signer

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ contract TAPCollector is EIP712, GraphDirectory, ITAPCollector {
2929
/// @notice The EIP712 typehash for the ReceiptAggregateVoucher struct
3030
bytes32 private constant EIP712_RAV_TYPEHASH =
3131
keccak256(
32-
"ReceiptAggregateVoucher(address payer,address collector,address serviceProvider,address dataService,uint64 timestampNs,uint128 valueAggregate,bytes metadata)"
32+
"ReceiptAggregateVoucher(address payer,address serviceProvider,address dataService,uint64 timestampNs,uint128 valueAggregate,bytes metadata)"
3333
);
3434

3535
/// @notice Authorization details for payer-signer pairs
@@ -168,12 +168,6 @@ contract TAPCollector is EIP712, GraphDirectory, ITAPCollector {
168168
) private returns (uint256) {
169169
(SignedRAV memory signedRAV, uint256 dataServiceCut) = abi.decode(_data, (SignedRAV, uint256));
170170

171-
// Ensure the RAV was issued to this collector
172-
require(
173-
signedRAV.rav.collector == address(this),
174-
TAPCollectorInvalidCollector(address(this), signedRAV.rav.collector)
175-
);
176-
177171
// Ensure caller is the RAV data service
178172
require(
179173
signedRAV.rav.dataService == msg.sender,
@@ -266,7 +260,6 @@ contract TAPCollector is EIP712, GraphDirectory, ITAPCollector {
266260
abi.encode(
267261
EIP712_RAV_TYPEHASH,
268262
_rav.payer,
269-
_rav.collector,
270263
_rav.serviceProvider,
271264
_rav.dataService,
272265
_rav.timestampNs,

packages/horizon/test/payments/tap-collector/collect/collect.t.sol

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ contract TAPCollectorCollectTest is TAPCollectorTest {
4242
function _getRAV(
4343
address _allocationId,
4444
address _payer,
45-
address _collector,
4645
address _indexer,
4746
address _dataService,
4847
uint128 _tokens
@@ -51,7 +50,6 @@ contract TAPCollectorCollectTest is TAPCollectorTest {
5150
ITAPCollector.ReceiptAggregateVoucher({
5251
collectionId: bytes32(uint256(uint160(_allocationId))),
5352
payer: _payer,
54-
collector: _collector,
5553
dataService: _dataService,
5654
serviceProvider: _indexer,
5755
timestampNs: 0,
@@ -111,27 +109,6 @@ contract TAPCollectorCollectTest is TAPCollectorTest {
111109
}
112110
}
113111

114-
function testTAPCollector_Collect_RevertWhen_OtherCollector() public useGateway useSigner {
115-
address otherCollector = makeAddr("otherCollector");
116-
bytes memory data = _getQueryFeeEncodedData(
117-
signerPrivateKey,
118-
users.gateway,
119-
otherCollector,
120-
users.indexer,
121-
users.verifier,
122-
uint128(0)
123-
);
124-
125-
resetPrank(users.verifier);
126-
bytes memory expectedError = abi.encodeWithSelector(
127-
ITAPCollector.TAPCollectorInvalidCollector.selector,
128-
address(tapCollector),
129-
otherCollector
130-
);
131-
vm.expectRevert(expectedError);
132-
tapCollector.collect(IGraphPayments.PaymentTypes.QueryFee, data);
133-
}
134-
135112
function testTAPCollector_Collect_RevertWhen_NoProvision(uint256 tokens) public useGateway useSigner {
136113
tokens = bound(tokens, 1, type(uint128).max);
137114

0 commit comments

Comments
 (0)