Skip to content

Commit

Permalink
feat: add rav collected event (#1056)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <[email protected]>
  • Loading branch information
tmigone authored Oct 4, 2024
1 parent 2284a3d commit f88f335
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/horizon/contracts/interfaces/ITAPCollector.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@ interface ITAPCollector is IPaymentsCollector {
bytes signature;
}

/**
* @notice Emitted when a RAV is collected
* @param payer The address of the payer
* @param dataService The address of the data service
* @param serviceProvider The address of the service provider
* @param timestampNs The timestamp of the RAV
* @param valueAggregate The total amount owed to the service provider
* @param metadata Arbitrary metadata
* @param signature The signature of the RAV
*/
event RAVCollected(
address indexed payer,
address indexed dataService,
address indexed serviceProvider,
uint64 timestampNs,
uint128 valueAggregate,
bytes metadata,
bytes signature
);

/**
* Thrown when the caller is not the data service the RAV was issued to
* @param caller The address of the caller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ contract TAPCollector is EIP712, GraphDirectory, ITAPCollector {
}

emit PaymentCollected(paymentType, payer, receiver, tokensToCollect, dataService, tokensDataService);
emit RAVCollected(
payer,
dataService,
receiver,
signedRAV.rav.timestampNs,
signedRAV.rav.valueAggregate,
signedRAV.rav.metadata,
signedRAV.signature
);
return tokensToCollect;
}

Expand Down

0 comments on commit f88f335

Please sign in to comment.