Skip to content

fix(#22): confirm is_claimed becomes true after release - #170

Merged
Kings9595 merged 2 commits into
Kings9595:mainfrom
Rayyanah0:fix/issue-22-is-claimed-after-release
Jun 28, 2026
Merged

fix(#22): confirm is_claimed becomes true after release#170
Kings9595 merged 2 commits into
Kings9595:mainfrom
Rayyanah0:fix/issue-22-is-claimed-after-release

Conversation

@Rayyanah0

Copy link
Copy Markdown
Contributor

Summary

Resolves #22 — confirms is_claimed becomes true after a successful release_issue_bounty call.

Changes

Core fix (issue #22)

  • Added dedicated integration test test_is_claimed_true_after_release in release_bounty.rs that asserts:
    • is_claimed returns false before any release
    • is_claimed returns true immediately after a successful release
    • a different issue on the same repo remains unclaimed

Missing error variants (compile fix)

  • Added InvalidRepoHash = 12 and InvalidDeveloper = 13 to the Error enum in types.rs — both were referenced in lib.rs but absent from the enum, preventing compilation.

Clawback design fix

  • Removed WaveGuard re-check from clawback_expired_funds; now uses address equality against pool.maintainer only. This isolates fund recovery from a potential WaveGuard registry compromise (documented in code comments and the audit notes in lib.rs).

InvalidDeveloper guard fix

  • Changed guard from all-zero bytes check to self-address check. Address::generate in 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

  • PoolNotExpiredClawbackTooEarly in error_enum_coverage.rs
  • TransferFailed discriminant 89 in error_enum_coverage.rs
  • Stranger clawback error UnauthorizedMaintainerUnauthorizedCaller in clawback.rs and unauthorized_access.rs
  • Removed .unwrap() on clawback_expired_funds call (returns () not Result) in unauthorized_access.rs
  • Fixed test_revoked_maintainer_cannot_clawback: replaced broken assertion referencing undeclared after/before with correct behavior (revoked pool creator can still clawback)

Testing

All 12 test suites pass — 0 failures:

test result: ok. 28 passed; 0 failed  (unit tests)
test result: ok. 6 passed; 0 failed   (claim_manipulation)
test result: ok. 7 passed; 0 failed   (clawback)
test result: ok. 8 passed; 0 failed   (create_pool)
test result: ok. 7 passed; 0 failed   (duplicate_claim)
test result: ok. 13 passed; 0 failed  (error_enum_coverage)
test result: ok. 6 passed; 0 failed   (full_lifecycle)
test result: ok. 3 passed; 0 failed   (milestone_balance_query)
test result: ok. 3 passed; 0 failed   (multi_developer_payouts)
test result: ok. 4 passed; 0 failed   (over_allocation)
test result: ok. 8 passed; 0 failed   (release_bounty)
test result: ok. 7 passed; 0 failed   (unauthorized_access)

- 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).
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Kings9595
Kings9595 merged commit 2ab100c into Kings9595:main Jun 28, 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.

Confirm is_claimed becomes true after release

2 participants