Skip to content

Feat/fix fee calculations #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

owl352
Copy link

@owl352 owl352 commented May 12, 2025

Issue being fixed or feature implemented

In this PR was removed incorrect calculations for TX Fee.

This is important because the current dashcore-lib release can't properly auto-calculate fees for transactions with many inputs.

What was done?

  • Added MINIMUM_FEE constant which contains minimum fee size in duffs (255)
  • Added setter for MINIMUM_FEE
  • New _estimateSize alghoritm
  • Update calculation of estimateFee

At this moment alghoritm for fee calculation works randomly, and with long steps. Updated code allows to calculate fee based on serialized transaction length

How Has This Been Tested?

  • Implemented new tests for new calculations
  • Updated old tests

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

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.

1 participant