Skip to content
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

feat(mining): automatically mine new blocks #707

Merged
merged 18 commits into from
May 1, 2023

Conversation

Jhoyola
Copy link
Contributor

@Jhoyola Jhoyola commented Apr 23, 2023

Closes #566

Based on the code of @zackypick
Continues the unmerged PR #613

Description

Added auto mine dropdown button with several options (Off, every 30s, every 1m / 5m / 10m)
Button includes embedded progress bar (time left to mine)

Steps to Test

  1. Click the new toolbar button for options
  2. Select any of the interval options
  3. Auto mine will start according to interval
  4. Verify that the blockheight changes when the progress bar goes to zero
  5. Change the interval on the fly, and verify, that the mining still works
  6. Select Off to turn down automine

Copy link
Owner

@jamaljsr jamaljsr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking over this PR.

I tested it and the functionality works as expected. This seems pretty much done. I just left a couple of minor tweaks.

@jamaljsr
Copy link
Owner

It looks like the unit tests are failing. Would you mind taking a look at them.

@Jhoyola
Copy link
Contributor Author

Jhoyola commented Apr 24, 2023

It looks like the unit tests are failing. Would you mind taking a look at them.

Yes, I'll see if I can fix them

@Jhoyola
Copy link
Contributor Author

Jhoyola commented Apr 26, 2023

Fixed the tests and added some new unit tests for the automine.

@Jhoyola Jhoyola force-pushed the feature/auto-mine branch from c696ebb to 46c09c2 Compare April 26, 2023 21:27
@Jhoyola
Copy link
Contributor Author

Jhoyola commented Apr 27, 2023

I will still edit the tests a bit to get the coverage to 100 so CI passes fully.

@Jhoyola
Copy link
Contributor Author

Jhoyola commented Apr 27, 2023

Sorry, didn't run the full CI before the last commit. Now it should be ok.

@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (4858a82) 100.00% compared to head (a86fd33) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #707   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          116       118    +2     
  Lines         3437      3528   +91     
  Branches       647       634   -13     
=========================================
+ Hits          3437      3528   +91     
Impacted Files Coverage Δ
src/components/designer/SyncButton.tsx 100.00% <ø> (ø)
src/components/designer/AutoMineButton.tsx 100.00% <100.00%> (ø)
...c/components/designer/bitcoind/BitcoindDetails.tsx 100.00% <100.00%> (ø)
src/components/designer/bitcoind/InfoTab.tsx 100.00% <100.00%> (ø)
...nts/designer/bitcoind/actions/SendOnChainModal.tsx 100.00% <100.00%> (ø)
src/components/network/NetworkActions.tsx 100.00% <100.00%> (ø)
src/hooks/useMiningAsync.ts 100.00% <100.00%> (ø)
src/store/models/bitcoind.ts 100.00% <100.00%> (ø)
src/store/models/network.ts 100.00% <100.00%> (ø)
src/utils/network.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Owner

@jamaljsr jamaljsr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work on the tests! Thanks for completing this feature. So happy to see this added.

@jamaljsr jamaljsr merged commit 5c3faf6 into jamaljsr:master May 1, 2023
@Jhoyola Jhoyola deleted the feature/auto-mine branch May 2, 2023 12:15
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.

Feature Request: Automatic mining every X minutes
4 participants