-
Notifications
You must be signed in to change notification settings - Fork 149
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
refactor: make bitcoin implementation flexible #1092
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1092 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 152 154 +2
Lines 5547 5567 +20
Branches 1082 1128 +46
=========================================
+ Hits 5547 5567 +20 ☔ View full report in Codecov by Sentry. |
Hey @Abdulkbk thanks for opening this draft PR to show what you've implemented so far. I skimmed through the diff and so far it's looking fantastic! I'm pleasantly surprised to see the test coverage still at 100%. 👌 Please let me know if you have any questions or need any assistance moving forward with this. |
Hey @jamaljsr thanks for taking the time to skim through this.
Yes, I try to add test to all new code as I add them👌.
Of course I will. I've been thinking of the best way I should add the |
Hey @jamaljsr, I am currently facing two blockers. I figured out a way for the first but I am still figuring out the second. The first is that BTCD has wallet functionalities decoupled from chain functionalities, unlike The second blocker is that I would love to hear your thoughts as I continue to figure a way out. Thanks. |
Hi @Abdulkbk,
Oh wow, you are correct! I honestly don't have all the answers right now on how to implement this best, but I'm willing to work with you if you are still interested in pursuing this. My hunch is that there will be more challenges along the way. We'll likely need to split this up into multiple PRs so reviewing the updates won't be too difficult. Let me know if you'd like to continue with this. I'd totally understand if this feels like too large of a project to tackle at this time. |
I agree this will require much more effort.
I would like to take this further. I will perhaps start by modifying this PR to focus on refactoring the implementation of the Bitcoin nodes to use a factory. Once I’ve completed that, I will request a review. |
17f4abb
to
ea5950e
Compare
In this commit, we refactor the designer components to make it possible for us to introduce another bitcoin node implementation later.
In this commit, we refactor how bitcoind is implemented and used, and moved to using injected factory so that other node implementa tions can be added later.
In this commit, we refactor the test files to use the new bitcoin factory implementation. We also added a test for the newly created notImplemented service file for bitcoin nodes.
ea5950e
to
7cfbed7
Compare
Hey @jamaljsr, I think this PR is ready for review. Thanks |
Description
This PR refactors the
bitcoin
implementation.Currently, the implementation only supports
bitcoind
, making it less flexible. This PR allows for the easy integration of otherbitcoin
implementations, such as BTCD, in the future.Approach:
The PR refactors the Bitcoin implementation to utilize
BitcoinFactory
, similar to the implementation for the Lightning network, which allows for various Lightning implementations in Polar. This change will also improve the flexibility of the Bitcoin implementation.Steps to Test
Since this is a refactor PR and does not change any behavior in Polar, you can test it normally by starting Polar and creating a network that involves
bitcoind
.Here are a few pointers to test:
bitcoind
nodes.bitcoind
backends for some Lightning nodes and perform various operations.