Skip to content

Task/betting events - #1053

Merged
greatest0fallt1me merged 3 commits into
Predictify-org:masterfrom
Ayomide-codex:task/betting-events
Jul 27, 2026
Merged

Task/betting events#1053
greatest0fallt1me merged 3 commits into
Predictify-org:masterfrom
Ayomide-codex:task/betting-events

Conversation

@Ayomide-codex

Copy link
Copy Markdown
Contributor

Pull Request Description

📋 Basic Information

Type of Change

  • ✨ New feature
  • 🧪 Test addition/update
  • 📚 Documentation update

Related Issues

Closes #870

Priority Level

  • 🟡 High

📝 Detailed Description

What does this PR do?

This PR adds structured betting lifecycle events to the betting smart contract (buffer #14). Relevant events are now emitted during state-changing betting operations, making it easier for off-chain indexers, explorers, and clients to track betting activity in a structured and reliable way.

Additionally:

  • Added focused unit tests covering event emission.
  • Updated documentation to reflect the newly emitted events.

Why is this change needed?

Previously, betting lifecycle actions did not emit structured events, making it difficult for external services to monitor contract activity efficiently. This implementation improves observability while providing a stable event interface for integrations and analytics.

How was this tested?

  • Added unit tests validating event emission for betting lifecycle operations.
  • Ran the project's test suite to ensure no regressions.
  • Verified emitted event topics and payloads match the expected structure.

🏗️ Smart Contract Specific

Contract Changes

  • Existing functions modified
  • Events added/modified

Security Considerations

  • Access control reviewed
  • Input validation
  • Overflow/underflow protection

🧪 Testing

Test Coverage

  • Unit tests added/updated
  • All tests passing locally
  • Edge cases covered

Test Results

cargo test
# All tests passed

📚 Documentation

Documentation Updates

  • Code comments added/updated
  • API documentation updated

Breaking Changes

Breaking Changes: None.


🔍 Code Quality

Code Review Checklist

  • Code follows Rust/Soroban best practices
  • Self-review completed
  • Error handling is appropriate
  • Security considerations addressed
  • Code is readable and well-commented

Performance Impact

  • Gas Usage: Minimal overhead from event emission.
  • Storage Impact: None.
  • Computational Complexity: No significant changes.

Security Review

  • No obvious security vulnerabilities
  • Access controls properly implemented
  • Input validation in place

🚀 Deployment & Integration

Deployment Notes

  • Migration Required: No
  • Backward Compatibility: Maintained

Integration Points

  • API changes documented
  • Backward compatibility maintained

📊 Impact Assessment

User Impact

  • End Users: No direct behavioral changes.
  • Developers: Can now subscribe to structured betting events for indexing, analytics, and frontend updates.

Business Impact

  • Improved observability and easier integration with off-chain services.

💬 Notes for Reviewers

Please review:

  • Event naming and payload structure.
  • Event emission points across the betting lifecycle.
  • Test coverage for emitted events and edge cases.

Add BetBatchPlacedEvent and BetStatsUpdatedEvent with emit methods,
update event topic catalog, and integrate emissions into betting code.

- BetBatchPlacedEvent: emitted for batch bet operations (place_bets)
- BetStatsUpdatedEvent: emitted when per-market bet stats change
- Event topic catalog updated with all betting lifecycle topics
- Focused tests for struct creation, publication, storage, and edge cases
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Ayomide-codex 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

@greatest0fallt1me
greatest0fallt1me merged commit a49e4ce into Predictify-org:master Jul 27, 2026
0 of 2 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.

Add structured events on betting (buffer #14)

2 participants