Skip to content

feat: implement participant deregistration, tiered rewards, api compression#381

Merged
joelpeace48-cell merged 2 commits into
FinesseStudioLab:mainfrom
dinahmaccodes:issue-mixx
May 29, 2026
Merged

feat: implement participant deregistration, tiered rewards, api compression#381
joelpeace48-cell merged 2 commits into
FinesseStudioLab:mainfrom
dinahmaccodes:issue-mixx

Conversation

@dinahmaccodes
Copy link
Copy Markdown
Contributor

Overview

This PR introduces platform infrastructure enhancements, smart contract upgrades, performance optimizations, and type-safe frontend integration.

Key Changes

1. Participant Deregistration (#330)

  • Campaign Contract: Implemented user-initiated deregister and admin-forced admin_deregister functions inside CampaignContract (lib.rs).
  • State & Count Correction: Correctly decrements the participant count upon deregistration.
  • Unit Tests: Added comprehensive test cases verifying user/admin deregistration permissions, state mutation validation, and events emission inside test.rs.

2. Tiered Reward Logic (#331)

  • Rewards Contract: Implemented set_tiers (configuring rank-based rewards) and credit_by_rank (crediting rewards determined by lookup rank) inside RewardsContract (lib.rs).
  • Optimized Lookup: Automatically sorts configured tiers using an on-chain bubble sort helper during setup to keep lookup complexity minimal.
  • Unit Tests: Verified correct sorting, tier lookups, and reward allocation in test.rs.

3. API Response Compression (#335)

  • Express Middleware: Registered Express compression middleware in backend/src/index.js to automatically gzip JSON payloads above a 1KB threshold.
  • Integration Tests: Added unit tests verifying gzip headers and compression thresholds in backend/src/index.test.js.

4. TypeScript Client Bindings & Type Safety (#328)

  • Generation Script: Added scripts/build-bindings.js which automates contract compilation, client typescript bindings generation via Stellar CLI, and modules cleanup.
  • Frontend Refactor: Replaced raw, untyped contract.call operations with the generated type-safe clients in frontend/src/stellar.js.
  • CI/CD Assertions: Updated .github/workflows/contracts-ci.yml to install Stellar CLI, compile contracts, regenerate typescript bindings, and run git diff --exit-code to ensure committed bindings never drift from on-chain logic.
  • Developer Guide: Documented bindings regeneration in CONTRIBUTING.md.

Verification Details

  • Built and ran all Rust contract test suites locally.
  • Verified Express backend middleware tests are successfully passing.
  • Validated typescript compiling and structure for campaign & rewards contract clients.

Closes #331
Closes #335
Closes #328
Closes #330

…ession, and automated type-safe contract clients
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@dinahmaccodes is attempting to deploy a commit to the joelpeace48-cell's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

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

@joelpeace48-cell joelpeace48-cell merged commit f59ba5c into FinesseStudioLab:main May 29, 2026
0 of 5 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

2 participants