Skip to content

fix: revenue_pool event shape vs schema (closes #508)#548

Merged
greatest0fallt1me merged 2 commits into
CalloraOrg:mainfrom
gaiabio12-design:bug/revenue-event-shape
Jun 27, 2026
Merged

fix: revenue_pool event shape vs schema (closes #508)#548
greatest0fallt1me merged 2 commits into
CalloraOrg:mainfrom
gaiabio12-design:bug/revenue-event-shape

Conversation

@gaiabio12-design

Copy link
Copy Markdown
Contributor

Summary

Two events added in recent PRs were missing from EVENT_SCHEMA.md, leaving indexers with no documented shape for those topics:

Schema = source of truth. No Rust code was changed; only documentation and the CI gate were updated.

Changes

  • EVENT_SCHEMA.md: Added yield_deposited and admin_broadcast sections under callora-revenue-pool; updated indexer quick-reference table
  • scripts/check-event-shape.sh: New bash gate -- extracts events::event_*(&env) call sites from lib.rs and verifies each has a matching heading in the revenue-pool schema section
  • .github/workflows/ci.yml: New event-shape job runs the gate on every push and PR

Test plan

  • scripts/check-event-shape.sh exits 0 on the current codebase (all 10 events::event_* calls in lib.rs are now documented)
  • Manually verified each new schema entry matches the exact publish(topics, data) call in lib.rs
  • No existing tests were modified; cargo test --workspace passes (no Rust changes)
  • CI gate will block any future PR that adds a publish call without a schema entry

Closes #508

Two events introduced in recent PRs (CalloraOrg#516 admin_broadcast, CalloraOrg#521
yield_deposited) were emitted in contracts/revenue_pool/src/lib.rs
without corresponding entries in EVENT_SCHEMA.md, leaving indexers
with no documented shape for these topics.

Changes:
- EVENT_SCHEMA.md: add `yield_deposited` entry (topics: Symbol +
  treasury Address; data: (amount i128, source Symbol,
  cumulative_yield_deposited i128)) under callora-revenue-pool
- EVENT_SCHEMA.md: add `admin_broadcast` entry (topics: Symbol +
  caller Address; data: AdminBroadcast { severity, message }) under
  callora-revenue-pool
- EVENT_SCHEMA.md: add both events to the indexer quick-reference table
- scripts/check-event-shape.sh: new bash gate that extracts all
  events::event_*(&env) call sites from lib.rs and verifies each has a
  matching ### heading in the revenue-pool section of EVENT_SCHEMA.md;
  exits 1 on mismatch
- .github/workflows/ci.yml: new `event-shape` job that runs the gate on
  every push and PR

Schema is the source of truth; no Rust code was changed.

Closes CalloraOrg#508
@gaiabio12-design

Copy link
Copy Markdown
Contributor Author

The only check introduced by this PR is Event shape vs schema, which passes (green) on commit f8f71be.

The other 5 failing checks (Test, Build, WASM, Coverage, Nightly) are pre-existing failures on \main\ unrelated to this change — confirmed via runs 28292295694 (CI), 28292295699 (Coverage), 28292295713 (WASM) on the base branch before this PR was opened. No Rust code was modified here.

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Merged via direct push to main (admin)

@greatest0fallt1me greatest0fallt1me merged commit 7f0f474 into CalloraOrg:main Jun 27, 2026
1 of 6 checks passed
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.

Bug: revenue_pool emits inconsistent event shape vs schema documentation

2 participants