docs: document bookmark event payload shapes with tests - #716
Open
Nife-tanny wants to merge 1 commit into
Open
Conversation
|
@Nife-tanny 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! 🚀 |
Add full event payload documentation for campaign_bookmarked and campaign_unbookmarked to EVENT_PAYLOADS.md, covering topics, data shape, types, and semantic meaning. The payload shape for both events is: topics = ("event_name", user: Address), data = campaign_id: u32.
Add two new tests as inline #[cfg(test)] module in src/bookmarks.rs: test_save_campaign_emits_campaign_bookmarked_event and test_remove_saved_campaign_emits_campaign_unbookmarked_event that verify: event name topic, user address topic (2 topics total), and campaign_id payload as u32.
Closes Iris-IV#662
Nife-tanny
force-pushed
the
docs/bookmark_events
branch
from
July 30, 2026 12:17
82dc9a1 to
a91034f
Compare
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
Documents the
campaign_bookmarkedandcampaign_unbookmarkedevent payload shapes in EVENT_PAYLOADS.md and adds focused event verification tests.Closes #662
Changes
EVENT_PAYLOADS.md
Added full payload documentation for two previously undocumented events:
campaign_bookmarked("campaign_bookmarked", user: Address)campaign_id: u32src/bookmarks.rs:34—save_campaign()campaign_unbookmarked("campaign_unbookmarked", user: Address)campaign_id: u32src/bookmarks.rs:56—remove_saved_campaign()Updated total documented
publish()call sites from 48 → 50.src/tests/test_bookmarks.rs
Added two new tests following existing Soroban event-testing conventions:
test_save_campaign_emits_campaign_bookmarked_event— Verifiessave_campaignemits exactly 1 event with topic"campaign_bookmarked", the caller address in topic[1], and thecampaign_idas au32payload.test_remove_saved_campaign_emits_campaign_unbookmarked_event— Same verification forremove_saved_campaignwith topic"campaign_unbookmarked".Both tests check:
Validation
Rust toolchain was not available in the CI environment to run
cargo fmt --check,cargo clippy, or tests locally. All changes follow the established codebase conventions exactly.No production behavior was modified — only documentation and tests were added.