feat: add get_effective_rule for per-merchant fallback resolution - #670
Open
samjay8 wants to merge 1 commit into
Open
feat: add get_effective_rule for per-merchant fallback resolution#670samjay8 wants to merge 1 commit into
samjay8 wants to merge 1 commit into
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-525
branch
from
August 30, 2026 21:03
def6ef8 to
785b0e6
Compare
…(issue Betta-Pay#525) Added get_effective_rule(merchant) that always returns a rule by following the full resolution chain: merchant-specific → global default → governance fee config → bootstrap fallback. Added an integration test covering the per-merchant fallback case. Also fixed unused variable warning in _transfer_admin. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
freebuff-web
Bot
force-pushed
the
fix/issue-525
branch
from
September 3, 2026 08:40
6d77cc4 to
9fd9b3f
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 #525
Summary
get_settlement_rulereturnsNonewhen no merchant-specific rule is stored, even though the merchant has an effective rule from the default/fallback chain that the API hides. This divergence means consumers see "no rule" for a merchant that actually has one.get_effective_rule(merchant)that always returns a rule by following the full resolution chain: merchant-specific → global default → governance fee config → bootstrap fallback.Scope
Does not modify existing
get_settlement_ruleorget_default_rule— purely additive. Does not touch write paths or payment logic.Testing
cargo check --workspace— passesget_effective_rule_resolves_global_default_for_merchant_without_rule— verifies global default is resolved when no merchant rule is storedcargo 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). Source code and new test compile cleanly.Files changed
settlement_contract/src/settlement.rs— addedget_effective_rulemethod with documentationsettlement_contract/src/tests/integration_tests.rs— added integration test for per-merchant fallback