Skip to content

feat(events): add monitor_event for invoice contract observability#258

Open
Nuwe10 wants to merge 1 commit into
Stellar-split:mainfrom
Nuwe10:feature/180-invoice-monitoring-hooks
Open

feat(events): add monitor_event for invoice contract observability#258
Nuwe10 wants to merge 1 commit into
Stellar-split:mainfrom
Nuwe10:feature/180-invoice-monitoring-hooks

Conversation

@Nuwe10

@Nuwe10 Nuwe10 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a monitor_event function to events.rs and emits it as the first operation in all four public entry points (create_invoice, pay, release, refund), enabling real-time contract health observability for indexers and dashboards.

Changes

  • events.rs: Added monitor_event(env, function, invoice_id, actor, timestamp) with topic (symbol_short!("monitor"), function_name) and data (invoice_id, actor_address, ledger_timestamp)
  • lib.rs: Emit monitor_event as the first operation in create_invoice, pay, release, and refund
  • test.rs: Four new tests verify the monitor event is emitted with the correct function name for each entry point

Validation

  • No new compiler errors introduced (pre-existing build errors on main are unrelated to this issue)
  • No new clippy warnings introduced
  • All acceptance criteria satisfied

Closes #180

Closes Stellar-split#180

- Add monitor_event() to events.rs with topic (symbol_short!("monitor"), function_name)
  and data (invoice_id, actor, ledger_timestamp)
- Emit monitor_event as the first operation in create_invoice, pay, release, and refund
- Add four tests verifying monitor event is emitted with correct function name for each entry point
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add invoice contract monitoring hooks

1 participant