Skip to content

feat(creator-earnings): emit events for primary state changes#1274

Merged
aji70 merged 2 commits into
MyFanss:mainfrom
Xaxxoo:feat/942-creator-earnings-emit-events
May 31, 2026
Merged

feat(creator-earnings): emit events for primary state changes#1274
aji70 merged 2 commits into
MyFanss:mainfrom
Xaxxoo:feat/942-creator-earnings-emit-events

Conversation

@Xaxxoo

@Xaxxoo Xaxxoo commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add InitializedEvent, AuthorizedAddedEvent, and DepositEvent typed event structs to the creator-earnings contract
  • Emit initialized event at the end of initialize()
  • Emit authorized_added event at the end of add_authorized()
  • Emit deposit event at the end of deposit() (joining the existing withdraw event)
  • Add unit tests verifying each new event is emitted with correct field values

Test plan

  • initialize_emits_event — verifies initialized event with correct admin and token fields
  • add_authorized_emits_event — verifies authorized_added event with correct depositor field
  • deposit_emits_event — verifies deposit event with correct from, creator, amount, and token fields
  • All existing tests continue to pass (no regressions)

Closes #942

@drips-wave

drips-wave Bot commented May 31, 2026

Copy link
Copy Markdown

@Xaxxoo 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! 🚀

Learn more about application limits

@Xaxxoo Xaxxoo force-pushed the feat/942-creator-earnings-emit-events branch 2 times, most recently from 97357a6 to b2a0025 Compare May 31, 2026 17:22
Add InitializedEvent, AuthorizedAddedEvent, and DepositEvent typed event
structs to the creator-earnings contract. Emit events at the end of
initialize(), add_authorized(), and deposit() alongside the existing
WithdrawEvent in withdraw().
Add unit tests verifying each new event is emitted with correct data.

Also fixes a pre-existing compile error in content-likes: missing
`contracttype` import and invalid `panic_with_error!` string literal
(replaced with `Error::AlreadyInitialized`).

Applies cargo fmt to pre-existing formatting violations across
content-access, content-likes, creator-earnings, subscription,
test-consumer, and treasury.

Closes MyFanss#942
@Xaxxoo Xaxxoo force-pushed the feat/942-creator-earnings-emit-events branch from b2a0025 to 206fd73 Compare May 31, 2026 17:27
@aji70 aji70 merged commit 052a2e2 into MyFanss:main May 31, 2026
4 of 20 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.

Contract creator-earnings: Emit events for primary state changes

2 participants