Skip to content

test_learn_token_zero_score_error_message tests submit_quiz_score instead of claim_reward #459

Closed

Description

@DeFiVC

What

The test test_learn_token_zero_score_error_message (line 360-381) expects #[should_panic(expected = "score must be greater than 0")] but calls pt_client.submit_quiz_score(...) with score 0. However, submit_quiz_score in progress-tracker accepts score 0 — it does NOT validate score > 0. The "score must be greater than 0" check exists only in learn-token's claim_reward (line 653-655). The test never calls claim_reward, so the expected panic never occurs.

Why

The test doesn't verify what its name claims. It passes for the wrong reason (or doesn't compile/run). There is no test that actually verifies claim_reward's behavior with score 0.

Scope

  • Fix the test to actually test claim_reward with a score of 0, which requires:
    1. Setting up a progress-tracker with a quiz submitted at score 0
    2. Calling claim_reward which should panic with "score must be greater than 0"
  • OR rename the test to accurately reflect what it tests

Acceptance Criteria

  • The test actually exercises the code path it claims to test
  • The test name matches the behavior being tested

Technical Context

  • tests/unit/error_message_tests.rs:360-381 — the test
  • contracts/progress-tracker/src/lib.rs:747-752 — submit_quiz_score accepts score 0
  • contracts/learn-token/src/lib.rs:653-655 — claim_reward rejects score 0

Activity

  1. added
    testsTest additions or improvements
    rustRust language
    mediumFunctionality impaired but workaround exists, edge case, partial feature
    on Sep 28, 2026
  2. canicefavour commented on Sep 29, 2026

    @canicefavour

    @canicefavour has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I can correct test_learn_token_zero_score_error_message so it submits a zero-score quiz through progress-tracker and then calls learn-token::claim_reward, exercising the actual "score must be greater than 0" failure path. I’ll keep the test name aligned with that behavior and verify the targeted unit test plus the full test suite passes.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @canicefavour to this issue.

  3. captainjoel2019-bit commented on Sep 29, 2026

    @captainjoel2019-bit

    @captainjoel2019-bit has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello, I’ve reviewed the test issue and understand the mismatch between "submit_quiz_score" and "claim_reward". I’m confident I can update the test to exercise the actual zero-score rejection path and ensure its name and expected panic message accurately reflect the behavior.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @captainjoel2019-bit to this issue.

  4. web3joker commented on Sep 29, 2026

    @web3joker

    @web3joker has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Having reviewed the task, I have a clear understanding of the problem and the expected solution. I’ll work on the fix with the design requirements and acceptance criteria as the main guidelines.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @web3joker to this issue.

  5. Ghost1290-star commented on Sep 29, 2026

    @Ghost1290-star

    @Ghost1290-star has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I’ve gone through the issue and understand the mismatch between the test name, the function it calls, and the actual location of the zero-score validation. I’d like to update "test_learn_token_zero_score_error_message" so it sets up a quiz submission with score "0" through "progress-tracker", then calls "claim_reward" and verifies the expected ""score must be greater than 0"" panic. I’ll make sure the test name and assertions accurately reflect the "learn-token" behavior without changing the contract logic. I’ll also run the relevant unit tests to confirm the corrected code path is actually exercised.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Ghost1290-star to this issue.

  6. Awosdot commented on Sep 29, 2026

    @Awosdot

    @Awosdot has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello Maintainer, I can fix this issue for you.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Awosdot to this issue.

  7. nwosum113-ui commented on Sep 29, 2026

    @nwosum113-ui
    Contributor

    @nwosum113-ui has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    hello maintaine, i would love to wok on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @nwosum113-ui to this issue.

  8. TheHalalHunter commented on Sep 29, 2026

    @TheHalalHunter

    @TheHalalHunter has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi maintainer
    I’d love to help out with this issue. I’ve checked the current codebase/documentation and know exactly what needs to be updated to make this clearer. I will ensure everything aligns perfectly with your existing contribution guidelines.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @TheHalalHunter to this issue.

  9. drips-wave commented on Sep 30, 2026

    @drips-wave

    Congratulations, @nwosum113-ui! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @nwosum113-ui: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  10. grantfox-oss commented on Oct 1, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @nwosum113-ui's PR #509 was approved and merged by @DeFiVC.

    🏆 @nwosum113-ui: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (471 total points). Track your full progress on GrantFox.

    👏 Great work, @nwosum113-ui! Keep contributing to ChainLearnOfficial.

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 programmediumFunctionality impaired but workaround exists, edge case, partial featurerustRust languagetestsTest additions or improvements

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions