Skip to content

feat(contract): emit events for content-likes state changes#1258

Open
wendypetersondev wants to merge 1 commit into
MyFanss:mainfrom
wendypetersondev:feat/922-content-likes-events
Open

feat(contract): emit events for content-likes state changes#1258
wendypetersondev wants to merge 1 commit into
MyFanss:mainfrom
wendypetersondev:feat/922-content-likes-events

Conversation

@wendypetersondev
Copy link
Copy Markdown
Contributor

Implements structured event emission for the content-likes Soroban contract.

Changes

  • Add structured event types (LikedEvent, UnlikedEvent) in new events module
  • Emit LikedEvent when user likes content (idempotent, no duplicate events)
  • Emit UnlikedEvent when user unlikes content
  • Add 3 unit tests verifying event emission and idempotent behavior
  • Add 3 integration tests from external caller perspective
  • Events follow Soroban SDK best practices with #[contracttype] decorator

Test Coverage

  • All 16 tests pass (10 existing + 6 new)
  • No regressions in related functionality

Fixes #922

- Add structured event types (LikedEvent, UnlikedEvent) in new events module
- Emit LikedEvent when user likes content (idempotent, no duplicate events)
- Emit UnlikedEvent when user unlikes content
- Add 3 unit tests verifying event emission and idempotent behavior
- Add 3 integration tests from external caller perspective
- Events follow Soroban SDK best practices with #[contracttype] decorator
- Topic constants (TOPIC_LIKED, TOPIC_UNLIKED) for indexer filtering
- No breaking changes to contract API or logic
- All existing tests pass, no regressions

Fixes MyFanss#922
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@wendypetersondev 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

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 content-likes: Emit events for primary state changes

1 participant