Skip to content

test(contracts): add edge case coverage for earn-quest contract (#307)#458

Merged
RUKAYAT-CODER merged 1 commit intoEarnQuestOne:mainfrom
TheDEV111:feat-edge-case-test-coverage
Apr 29, 2026
Merged

test(contracts): add edge case coverage for earn-quest contract (#307)#458
RUKAYAT-CODER merged 1 commit intoEarnQuestOne:mainfrom
TheDEV111:feat-edge-case-test-coverage

Conversation

@TheDEV111
Copy link
Copy Markdown

Summary

Closes #307

Adds contracts/earn-quest/tests/test_edge_cases.rs — a new integration test
file covering edge cases that were not exercised by the existing focused unit
tests (test_validation.rs, test_bounds_checking.rs, test_dispute.rs, etc.).

What was tested

Category # Tests
Contract initialization guard 3
Deadline boundary values (MIN/MAX duration ±1s) 4
Commit-reveal flow errors 6
Claim on non-approved / non-existent submissions 4
Quest lifecycle with paused / expired status 5
Dispute state-machine violations 7
Batch size limit enforcement 2
Reward-range query edge cases 3
Platform & creator stats 4
Quest cancellation authorization 2
Admin role management 2
Total 43

Test results

…QuestOne#307)

Add contracts/earn-quest/tests/test_edge_cases.rs with 43 tests covering
gaps not addressed by existing focused unit tests:

- Contract initialization guard (double-init panic, role defaults)
- Deadline boundary values (exactly MIN/MAX duration, one second over/under)
- Commit-reveal flow (wrong salt, wrong proof, double commit, reveal without
  prior commit, commit on expired/nonexistent quest)
- Claim guards (Pending submission, nonexistent submission/quest)
- Quest lifecycle violations (submit to paused/expired quest, pause
  already-paused, resume already-active, pause nonexistent quest)
- Dispute state-machine (duplicate pending, wrong arbitrator, withdraw after
  resolve, appeal before resolve, nonexistent dispute, reopen after withdraw)
- Batch size limits (register_quests_batch and approve_submissions_batch
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

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

@TheDEV111
Copy link
Copy Markdown
Author

@RUKAYAT-CODER pls review and merge

@RUKAYAT-CODER RUKAYAT-CODER merged commit fbc6659 into EarnQuestOne:main Apr 29, 2026
0 of 3 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.

Edge Case Test Coverage

2 participants