Creators may want to make certain matches (e.g. a tournament final) worth more
than others to build excitement toward the end of a campaign.
Goal
Let a creator mark a match with a points_multiplier (e.g. 2 = double
points). Grading (Issue 3) multiplies the earned points by this value.
Requirements
-
Match struct gains:
pub points_multiplier: u32, // 1 = normal (default), 2 = double, etc.
-
r#match::create_match (Issue 1) gains an optional
points_multiplier: u32 param. New MatchError variant:
InvalidPointsMultiplier = 7 — points_multiplier == 0 || points_multiplier > 3
(cap at 3x to keep totals bounded; document the cap as a named constant
MAX_POINTS_MULTIPLIER in storage_types.rs)
- If you don't want to change
create_match's signature again so soon
after Issue 1, an acceptable alternative is a separate
set_match_points_multiplier(caller, match_id, multiplier) admin/creator-only
function called before the match starts. Pick whichever the maintainers
prefer — flag this in the PR description.
-
Grading change in oracle::submit_match_result (from Issue 3):
let base_points = if exact_correct { POINTS_CORRECT_RESULT + POINTS_EXACT_SCORE }
else if result_correct { POINTS_CORRECT_RESULT }
else { 0 };
let points = base_points * match_record.points_multiplier;
-
list_event_matches / get_match naturally surface points_multiplier
since it's just a struct field — no extra view needed, but confirm the
frontend types doc (if any) is updated.
Acceptance criteria
Testing checklist
Creators may want to make certain matches (e.g. a tournament final) worth more
than others to build excitement toward the end of a campaign.
Goal
Let a creator mark a match with a
points_multiplier(e.g.2= doublepoints). Grading (Issue 3) multiplies the earned points by this value.
Requirements
Matchstruct gains:r#match::create_match(Issue 1) gains an optionalpoints_multiplier: u32param. NewMatchErrorvariant:InvalidPointsMultiplier = 7—points_multiplier == 0 || points_multiplier > 3(cap at 3x to keep totals bounded; document the cap as a named constant
MAX_POINTS_MULTIPLIERinstorage_types.rs)create_match's signature again so soonafter Issue 1, an acceptable alternative is a separate
set_match_points_multiplier(caller, match_id, multiplier)admin/creator-onlyfunction called before the match starts. Pick whichever the maintainers
prefer — flag this in the PR description.
Grading change in
oracle::submit_match_result(from Issue 3):list_event_matches/get_matchnaturally surfacepoints_multipliersince it's just a struct field — no extra view needed, but confirm the
frontend types doc (if any) is updated.
Acceptance criteria
points_multiplier == 1(no behavior change forexisting/normal matches)
Testing checklist
test_create_match_with_double_points_multipliertest_create_match_invalid_multiplier_rejected—0and4both rejectedtest_grading_applies_points_multiplier— 2x match, exact score →points_earned == Some(8)test_leaderboard_reflects_multiplied_points(integration with Issue 4)