Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.
/ bux Public archive
generated from mrz1836/go-template

fix(BUX-461) fee quotes for both arc and mAPI with user defined fee quote#533

Merged
chris-4chain merged 12 commits intomasterfrom
fix-461-arc-fee-quotes
Jan 12, 2024
Merged

fix(BUX-461) fee quotes for both arc and mAPI with user defined fee quote#533
chris-4chain merged 12 commits intomasterfrom
fix-461-arc-fee-quotes

Conversation

@chris-4chain
Copy link
Contributor

@chris-4chain chris-4chain commented Jan 11, 2024

Pull Request Checklist

  • 📖 I created my PR using provided : CODE_STANDARDS
  • 📖 I have read the short Code of Conduct: CODE_OF_CONDUCT
  • 🏠 I tested my changes locally.
  • ✅ I have provided tests for my changes.
  • 📝 I have used conventional commits.
  • 📗 I have updated any related documentation.
  • 💾 PR was issued based on the Github or Jira issue.

The primary goal of this task was to calculate the lowest fee for ARC mode, similar to what is done with mAPI. Additionally, to allow users (e.g., bux-server) configure a fee unit (satoshis/bytes) when use_fee_quotes is disabled.

To accomplish this, I had to rewrite some parts of the chainstate package. This was mainly due to the chainstate.Client being tightly coupled with minercraft.

I moved the minercraft initialization functions to minercraft_init.go. Then, I created another file broadcast_client_init.go, which contains an algorithm to calculate the lowest fee based on the GetFeeQuote function from the broadcast-client.

For reviewers:
The most interesting files to review are:

  • chainstate/client.go
  • chainstate/minercraft_init.go
  • chainstate/broadcast_client_init.go
  • model_draft_transaction.go

@chris-4chain chris-4chain requested a review from a team as a code owner January 11, 2024 12:48
@mergify mergify bot added the bug-P3 Lowest rated bug, affects nearly none or low-impact label Jan 11, 2024
@mergify
Copy link
Contributor

mergify bot commented Jan 11, 2024

Welcome to our open-source project @chris-4chain! 💘

@codecov
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 82 lines in your changes are missing coverage. Please review.

Comparison is base (7279b7a) 51.85% compared to head (2410e8e) 51.88%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
+ Coverage   51.85%   51.88%   +0.03%     
==========================================
  Files         107      109       +2     
  Lines       11191    11250      +59     
==========================================
+ Hits         5803     5837      +34     
- Misses       4927     4946      +19     
- Partials      461      467       +6     
Flag Coverage Δ
unittests 51.88% <67.46%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
chainstate/broadcast_providers.go 60.71% <100.00%> (ø)
chainstate/minercraft_default.go 100.00% <100.00%> (ø)
chainstate/mock_minercraft.go 16.41% <100.00%> (ø)
chainstate/transaction.go 83.17% <100.00%> (ø)
model_draft_transactions.go 73.53% <100.00%> (-0.21%) ⬇️
chainstate/client_options.go 67.61% <71.42%> (-8.44%) ⬇️
utils/fees.go 90.69% <84.61%> (-9.31%) ⬇️
client_options.go 75.71% <0.00%> (+1.06%) ⬆️
chainstate/client.go 65.95% <64.70%> (-14.48%) ⬇️
chainstate/broadcast_client_init.go 55.17% <55.17%> (ø)
... and 1 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7279b7a...2410e8e. Read the comment docs.

@dorzepowski dorzepowski force-pushed the fix-461-arc-fee-quotes branch from cb1af03 to 2410e8e Compare January 12, 2024 10:22
@chris-4chain chris-4chain merged commit 11aa494 into master Jan 12, 2024
@chris-4chain chris-4chain deleted the fix-461-arc-fee-quotes branch January 12, 2024 10:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug-P3 Lowest rated bug, affects nearly none or low-impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants