Skip to content

refactor(fee-utils): name the 15% fee buffer constant (closes #1038) - #1068

Open
jdjioe5-cpu wants to merge 1 commit into
FlowwStar:mainfrom
jdjioe5-cpu:refactor/issue-1038-fee-buffer-multiplier
Open

jdjioe5-cpu wants to merge 1 commit into
FlowwStar:mainfrom
jdjioe5-cpu:refactor/issue-1038-fee-buffer-multiplier

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown
Contributor

Summary

Closes #1038

This PR addresses the refactoring request in issue #1038 by naming the 15% safety buffer constant used in lib/fee-utils.ts:

  • Hoists the inline const bufferMultiplier = 1.15; into an exported, documented module constant: export const FEE_BUFFER_MULTIPLIER = 1.15;.
  • Includes JSDoc documentation explaining the 15% safety buffer multiplier applied to resource fees.
  • Updates unit tests in __tests__/lib/fee-utils.test.ts to assert that FEE_BUFFER_MULTIPLIER is exported with the expected value (1.15) and replaces inline magic numbers in calculation assertions.

Changes

  • lib/fee-utils.ts: Export FEE_BUFFER_MULTIPLIER = 1.15 and use it inside calculateFeeBreakdown.
  • __tests__/lib/fee-utils.test.ts: Import FEE_BUFFER_MULTIPLIER, add dedicated unit test, and use the constant in fee calculation assertions.

Verification

  • All 15 unit tests in __tests__/lib/fee-utils.test.ts pass (npx vitest run fee-utils).
  • Cleanly mergeable with upstream.

This branch had an error being deployed

1 failed deployment
staging — 380f6543 Deployed Oct 24, 2026 by jdjioe5-cpu via deploy-staging #361
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.

Name the 15% fee buffer constant in fee-utils.ts

1 participant