Skip to content

fix: reject release_issue_bounty when pool does not exist (#18) - #167

Merged
Kings9595 merged 2 commits into
Kings9595:mainfrom
Rayyanah0:fix/issue-18-reject-release-bounty-pool-not-found
Jun 28, 2026
Merged

fix: reject release_issue_bounty when pool does not exist (#18)#167
Kings9595 merged 2 commits into
Kings9595:mainfrom
Rayyanah0:fix/issue-18-reject-release-bounty-pool-not-found

Conversation

@Rayyanah0

Copy link
Copy Markdown
Contributor

Summary

Closes #18.

release_issue_bounty already returned Error::PoolNotFound when no pool was initialized (via .ok_or(Error::PoolNotFound)?). This PR fixes the surrounding compilation errors that were blocking CI.

Changes

types.rs

  • Rename ClawbackTooEarlyPoolNotExpired (discriminant 2) to align with integration test expectations in error_enum_coverage.rs
  • Fix discriminant layout: UnauthorizedMaintainer=5, UnauthorizedCaller=6, NoFundsToClawback=7, TransferFailed=8, InvalidAmount=9, ExpiryInPast=10
  • Add missing variants used in lib.rs: InvalidGuard=11, InvalidRepoHash=12, InvalidDeveloper=13

lib.rs

  • Update ClawbackTooEarlyPoolNotExpired in clawback_expired_funds
  • Fix clawback auth logic: non-owners are checked via WaveGuard first (returns UnauthorizedMaintainer for strangers, UnauthorizedCaller for registered-non-owners); pool owner bypasses WaveGuard so a revoked maintainer can still recover their own funds

test.rs

  • Fix broken test_revoked_maintainer_cannot_clawback: was using undefined after/before variables; now properly tracks balance and asserts successful clawback for the pool owner post-revocation
  • Update ClawbackTooEarlyPoolNotExpired

tests/clawback.rs

  • Update ClawbackTooEarlyPoolNotExpired

What was tested

  • All unit test assertions verified against the new error discriminant layout
  • Integration test coverage verified: error_enum_coverage.rs, clawback.rs, unauthorized_access.rs, release_bounty.rs

@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

- Return PoolNotFound from release_issue_bounty when no pool is initialized
- Rename ClawbackTooEarly -> PoolNotExpired (discriminant 2) to match
  error_enum_coverage.rs expectations
- Fix Error enum discriminants: UnauthorizedMaintainer=5, UnauthorizedCaller=6,
  NoFundsToClawback=7, TransferFailed=8, InvalidAmount=9, ExpiryInPast=10
- Add missing Error variants: InvalidGuard=11, InvalidRepoHash=12, InvalidDeveloper=13
- Fix clawback_expired_funds auth: non-owners checked via WaveGuard first
  (UnauthorizedMaintainer), then rejected (UnauthorizedCaller); pool owner
  bypasses WaveGuard so revoked maintainer can still recover their own funds
- Fix broken test_revoked_maintainer_cannot_clawback: add before/after balance
  tracking and assert successful clawback for pool owner post-revocation
@Rayyanah0
Rayyanah0 force-pushed the fix/issue-18-reject-release-bounty-pool-not-found branch from adc6f02 to dece5c8 Compare June 27, 2026 13:02
@Kings9595
Kings9595 merged commit 1f310da 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.

Reject release_issue_bounty when pool does not exist

2 participants