test(contracts): add edge case coverage for earn-quest contract (#307)#458
Merged
RUKAYAT-CODER merged 1 commit intoEarnQuestOne:mainfrom Apr 29, 2026
Merged
Conversation
…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
|
@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! 🚀 |
Author
|
@RUKAYAT-CODER pls review and merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #307
Adds
contracts/earn-quest/tests/test_edge_cases.rs— a new integration testfile 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
MIN/MAXduration ±1s)Test results