Skip to content

test(fees): cover strategy selection and fallback - #1074

Open
Moonwalker-rgb wants to merge 1 commit into
MettaChain:mainfrom
Moonwalker-rgb:fix/1027-fees-strategy-tests
Open

test(fees): cover strategy selection and fallback#1074
Moonwalker-rgb wants to merge 1 commit into
MettaChain:mainfrom
Moonwalker-rgb:fix/1027-fees-strategy-tests

Conversation

@Moonwalker-rgb

@Moonwalker-rgb Moonwalker-rgb commented Aug 27, 2026

Copy link
Copy Markdown

Closes #1027

Summary

The strategy-selection logic in contracts/fees/src/strategies.rs had no test coverage, so changes to how fees are computed per operation/config shipped unpinned.

Changes

New tests in contracts/fees/src/tests.rs assert:

  • Each calculation method selects its own fee path: fixed (ignores congestion), dynamic (scales with congestion), tiered (picks the multiplier from the operation type, with fallback to the 1x tier), and exponential (squares the congestion factor).
  • get_config falls back to the default config (and thus the default strategy) for operations without a dedicated config.

Verification

  • cargo test -p propchain-fees passes (45 tests).

Assert each calculation method selects its own fee path (fixed,
dynamic, tiered, exponential) and that operations without a dedicated
config fall back to the default strategy. Fixes MettaChain#1027.
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@Moonwalker-rgb 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

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.

Fees strategies module has no test coverage: strategy selection is unpinned

1 participant