Skip to content

Commit f88f335

Browse files
authored
feat: add rav collected event (#1056)
Signed-off-by: Tomás Migone <[email protected]>
1 parent 2284a3d commit f88f335

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

packages/horizon/contracts/interfaces/ITAPCollector.sol

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@ interface ITAPCollector is IPaymentsCollector {
3434
bytes signature;
3535
}
3636

37+
/**
38+
* @notice Emitted when a RAV is collected
39+
* @param payer The address of the payer
40+
* @param dataService The address of the data service
41+
* @param serviceProvider The address of the service provider
42+
* @param timestampNs The timestamp of the RAV
43+
* @param valueAggregate The total amount owed to the service provider
44+
* @param metadata Arbitrary metadata
45+
* @param signature The signature of the RAV
46+
*/
47+
event RAVCollected(
48+
address indexed payer,
49+
address indexed dataService,
50+
address indexed serviceProvider,
51+
uint64 timestampNs,
52+
uint128 valueAggregate,
53+
bytes metadata,
54+
bytes signature
55+
);
56+
3757
/**
3858
* Thrown when the caller is not the data service the RAV was issued to
3959
* @param caller The address of the caller

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ contract TAPCollector is EIP712, GraphDirectory, ITAPCollector {
8585
}
8686

8787
emit PaymentCollected(paymentType, payer, receiver, tokensToCollect, dataService, tokensDataService);
88+
emit RAVCollected(
89+
payer,
90+
dataService,
91+
receiver,
92+
signedRAV.rav.timestampNs,
93+
signedRAV.rav.valueAggregate,
94+
signedRAV.rav.metadata,
95+
signedRAV.signature
96+
);
8897
return tokensToCollect;
8998
}
9099

0 commit comments

Comments
 (0)