fix: align scheduled path check order with direct path - #666
Open
samjay8 wants to merge 1 commit into
Open
Conversation
|
@samjay8 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! 🚀 |
freebuff-web
Bot
force-pushed
the
fix/issue-523
branch
3 times, most recently
from
September 3, 2026 08:40
acd79a8 to
c18baa6
Compare
…ay#523) Added validate_fee_against_governance to the scheduled path and reordered checks to match the direct path. Canonical check order is now: pause → governance fee → fee bounds → delay → merchant registration. Added a matrix test that asserts error-code parity across both paths. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
freebuff-web
Bot
force-pushed
the
fix/issue-523
branch
from
September 3, 2026 08:58
c18baa6 to
f18819e
Compare
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.
Closes #523
Summary
_set_settlement_rule) and direct (set_settlement_rule) paths enforced different validation orderings, causing the observable error to vary by path for the same invalid input.validate_fee_against_governanceto the scheduled path and reordered checks to match the canonical order: pause → governance fee → fee bounds → delay → merchant registration.Error-precedence matrix (after fix)
Paused(5)Paused(5)Paused(5)Paused(5)Paused(5)Paused(5)Paused(5)Paused(5)InvalidFeeBps(4)InvalidFeeBps(4)InvalidFeeBps(4)InvalidFeeBps(4)MerchantMissing(302)MerchantMissing(302)Scope
Does not touch other
_set_*functions, event emission, or storage TTL logic — limited to check ordering in_set_settlement_ruleonly.Testing
cargo check --workspace— passescargo test -p settlement_contract --libhas pre-existing compilation errors in upstream'sintegration_tests.rs(unrelated type mismatches from recent PRs fix: scope payment references per merchant (closes #493) #657–test: cover governance authorization paths #663). The source code and new test compile cleanly.Files changed
settlement_contract/src/admin.rs— addedvalidate_fee_against_governanceimport and reordered checks in_set_settlement_rulesettlement_contract/src/tests/admin_tests.rs— added matrix test for check-order parity