feat: implement event categories and tags for filtering#284
Merged
greatest0fallt1me merged 2 commits intoJan 31, 2026
Merged
Conversation
greatest0fallt1me
self-requested a review
January 31, 2026 09:10
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.
Pull Request: Add Event Categories and Tags for Client Filtering
Overview
This PR introduces optional categories and tags to events, enabling clients to filter and display markets by category (e.g., sports, crypto, politics) and custom tags. The feature is fully backward compatible and does not affect event resolution or payout logic.
Description
What's Being Added
Key Features
Changes Made
Smart Contract Changes (
src/lib.rs)create_eventFunctioncategoryparameter (string or enum)tagsparameter (Vec)EventCreatedevent with category and tagsupdate_eventFunctionEventUpdatedevent on successful category/tags updateType Definitions & Storage
Eventstruct to includecategory: Option<String>andtags: Option<Vec<String>>Query Functions & Documentation
query_events_by_category: Filter events by category with pagination supportquery_events_by_tags: Filter events that contain one or more specified tagsquery_events_by_category_and_tags: Combined filtering with AND/OR logicget_event: Updated to return category and tags in event dataTesting
Test Coverage
Creation Tests
Update Tests
Query Tests
Security & Edge Cases
Security Notes
Backward Compatibility
✅ Fully backward compatible
Affected Components
NOT Affected
Documentation
Review Checklist
Deployment Notes
Related Issues
Closes: #255
Screenshots / Examples
Creating an Event with Category & Tags
Querying Events by Category
Querying Events by Tags