Repository navigation
Add contract event emissions for timelock, fee calculator, fee distributor, and platform stats - #182
Merged
Conversation
…s silently w Closes terngunan#113
…ment_caller Closes terngunan#114
… when distri Closes terngunan#115
… events prev Closes terngunan#116
|
@aishabellova Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add contract event emissions for timelock, fee calculator, fee distributor, and platform stats
What was solved
#113 — admin_timelock: prune_change removes change records silently without emitting a pruning event
Add a
ChangePrunedEvent { change_id: BytesN<32> }to the admin_timelock contract and publish it as("TIMELOCK", "change_pruned")insideprune_change, plus a unit test asserting the event is emitted when a change is pruned.Addressed:
struct ChangePrunedEvent { change_id: BytesN<32> }insettliq_contracts/contracts/admin_timelock/src/lib.rs("TIMELOCK", "change_pruned")withChangePrunedEventinprune_changeafter removing the change recordsettliq_contracts/contracts/admin_timelock/src/test.rsasserting the pruning event is emitted#114 — fee_calculator: Missing audit events on set_settlement_caller and set_min_fee_stroops updates
Add audit event emissions to fee_calculator's set_settlement_caller and set_min_fee_stroops, defining SettlementCallerUpdatedEvent and MinFeeUpdatedEvent, and add unit tests verifying event publication.
Addressed:
#115 — fee_distributor: set_allowed_caller emits no event when distribution authority is changed
Add an AllowedCallerUpdatedEvent emission to fee_distributor's set_allowed_caller so caller-authorization changes are observable, and add a unit test asserting the event is published on caller rotation.
Addressed:
#116 — platform_stats: Metric update functions lack audit events preventing real-time event-driven telemetry
Add Soroban contract events to the platform_stats contract so that record_merchant, record_payment, and set_partner_ok emit MerchantRecordedEvent, PaymentRecordedEvent, and PartnerHealthUpdatedEvent respectively, enabling off-chain indexers and Prometheus exporters to consume real-time telemetry via event streaming instead of polling. Add unit tests in the platform_stats test module verifying the emitted event payloads.
Addressed:
Changes
settliq_contracts/contracts/admin_timelock/src/lib.rs(modify)settliq_contracts/contracts/fee_calculator/src/lib.rs(modify)settliq_contracts/contracts/fee_calculator/src/test.rs(modify)settliq_contracts/contracts/fee_distributor/src/lib.rs(modify)settliq_contracts/contracts/platform_stats/src/lib.rs(modify)settliq_contracts/contracts/platform_stats/src/test.rs(modify)Approach
Issues
Closes #113
Closes #114
Closes #115
Closes #116