Skip to content

Build key rating submission function with running average update #957

Description

@Chucks1093

Summary

Implement the on-chain key rating function that accepts holder ratings, maintains a running average, and prevents non-holders from submitting ratings.

Scope

  • rate_key() accepts score 1-5 from authenticated holder
  • Minimum holding balance required to submit
  • Running average updated using incremental formula on each submission
  • One rating per wallet — re-submission updates average correctly
  • KeyRated event emitted with new score, wallet, and updated average

Acceptance Criteria

  • Ratings rejected from wallets below minimum holding
  • Running average updated correctly on first and subsequent submissions
  • Re-submission from same wallet recalculates average without double-counting
  • KeyRated event emitted with correct fields
  • Unit tests cover first rating, re-rating, and non-holder rejection

ETA

24 hours

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions