fix: revoke verification on description update, validate platform fee maximum#573
Open
jacktruedream wants to merge 1 commit into
Open
fix: revoke verification on description update, validate platform fee maximum#573jacktruedream wants to merge 1 commit into
jacktruedream wants to merge 1 commit into
Conversation
… maximum Resolves Iris-IV#545 Resolves Iris-IV#548 Resolves Iris-IV#549
|
@jacktruedream 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! 🚀 |
davidmaronio
requested changes
Jul 4, 2026
davidmaronio
left a comment
Contributor
There was a problem hiding this comment.
appreciate the pr but both changes need rework:
- revoke-on-description-update is inverted. update.rs:64 adds require_unverified_campaign(&campaign)? which rejects verified campaigns from updating their description at all, and then campaign.is_verified = false at line 75 is dead code (the guard already guarantees unverified). the issue wants verification to be revoked when the description changes, not for the update to be blocked. so this does the opposite of the intended behavior.
- the platform-fee bound is a no-op. admin.rs:162 becomes
if new_fee > PLATFORM_FEE_MAX_BPS || new_fee > 10000, but PLATFORM_FEE_MAX_BPS is 1000, so the second clause is unreachable, and there's no plan-bounds validation added.
also test is red (the require_unverified guard likely breaks the existing update-description tests).
heads up this overlaps #579, which implements the revoke correctly (conditionally clears is_verified and decrements the verified-campaign counter, with a test). i'd suggest closing this in favor of #579 unless you want to rework it to conditionally revoke (and drop the dead fee clause).
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.
What
Fixed three issues related to campaign verification, platform fee validation, and struct handling in read-only queries.
Issues Resolved
Closes #545
Closes #548
Closes #549
Changes
#545 - Bug: update_campaign_description fails to clear verified status
Added check to revoke verification when campaign description is updated:
#548 - Performance: update_platform_fee validation against reasonable maximums
Added explicit maximum fee validation:
#549 - Performance: Campaign struct passed by reference in queries
Code review verified that Campaign is already passed by reference in: