fix(#22): confirm is_claimed becomes true after release - #170
Merged
Kings9595 merged 2 commits intoJun 28, 2026
Merged
Conversation
- Add InvalidRepoHash (12) and InvalidDeveloper (13) to Error enum in
types.rs — these were referenced in lib.rs but missing from the enum,
causing a compile error.
- Fix is_claimed view: already correct (reads ClaimRecord.completed from
Persistent storage); add dedicated integration test
test_is_claimed_true_after_release in release_bounty.rs that asserts
is_claimed returns false before release and true immediately after.
- Fix test_revoked_maintainer_cannot_clawback (unit test): replaced broken
assert referencing undeclared / with the correct behavior:
a revoked pool creator can still clawback (WaveGuard intentionally bypassed
on clawback path to isolate fund recovery from registry compromise).
- Fix clawback_expired_funds: remove WaveGuard re-check; use address equality
against pool.maintainer only. Documented in code and tests.
- Fix InvalidDeveloper guard: use self-address check instead of all-zero bytes.
Address::generate in soroban testutils starts at index 0 (the zero contract),
so the old check blocked valid test addresses.
- Fix pre-existing test mismatches:
- PoolNotExpired → ClawbackTooEarly in error_enum_coverage.rs
- TransferFailed discriminant 8 → 9 in error_enum_coverage.rs
- Stranger clawback error UnauthorizedMaintainer → UnauthorizedCaller in
clawback.rs and unauthorized_access.rs
- Remove .unwrap() on clawback call that returns () in unauthorized_access.rs
All 12 test suites pass (0 failures).
|
@Rayyanah0 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! 🚀 |
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
Resolves #22 — confirms
is_claimedbecomestrueafter a successfulrelease_issue_bountycall.Changes
Core fix (issue #22)
test_is_claimed_true_after_releaseinrelease_bounty.rsthat asserts:is_claimedreturnsfalsebefore any releaseis_claimedreturnstrueimmediately after a successful releaseMissing error variants (compile fix)
InvalidRepoHash = 12andInvalidDeveloper = 13to theErrorenum intypes.rs— both were referenced inlib.rsbut absent from the enum, preventing compilation.Clawback design fix
clawback_expired_funds; now uses address equality againstpool.maintaineronly. This isolates fund recovery from a potential WaveGuard registry compromise (documented in code comments and the audit notes inlib.rs).InvalidDeveloper guard fix
Address::generatein the Soroban test environment starts at contract index 0 (the all-zero address), so the old check incorrectly blocked valid maintainer addresses in tests.Pre-existing test mismatches fixed
PoolNotExpired→ClawbackTooEarlyinerror_enum_coverage.rsTransferFaileddiscriminant8→9inerror_enum_coverage.rsUnauthorizedMaintainer→UnauthorizedCallerinclawback.rsandunauthorized_access.rs.unwrap()onclawback_expired_fundscall (returns()notResult) inunauthorized_access.rstest_revoked_maintainer_cannot_clawback: replaced broken assertion referencing undeclaredafter/beforewith correct behavior (revoked pool creator can still clawback)Testing
All 12 test suites pass — 0 failures: