-
Notifications
You must be signed in to change notification settings - Fork 38
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
Replace bcoin with bitcoinjs-lib for deposits #702
Conversation
ef82753
to
ec8a499
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! Some comments and questions:
// TODO: Add support for other utxo types along with unit tests for the | ||
// given type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we plan to do this work as part of #695 or separately? If this is something quick I'd vote for the first option. Otherwise, we can postpone it now and return here after the release of the reworked API. On a high level, our work plan is remove bcoin -> bump node -> release v1.4.0 -> API changes -> release v2.0.0 -> improvements
so we can return here during improvements
phase. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's postpone it, as supporting more types require adding unit tests.
ac2f64d
to
36ad06f
Compare
There was a change in keep-network/tbtc-v2#702 in which we've added additional arguments to `assembleDepositTransaction` function. The order of the arguments was also changed. Because of that we couldn't build the project because we use that function in our dApp mock of the bitcoin client. We are fixing this by passing two additional arguments to the `assembleDepositTransaction` function - `network` and `fee`. We are also making sure that we pass the arguments in the correct order.
Here we pull changes from #702
Here we pull changes from #702
There was a change in keep-network/tbtc-v2#702 in which we've added additional arguments to `assembleDepositTransaction` function. The order of the arguments was also changed. Because of that we couldn't build the project because we use that function in our dApp mock of the bitcoin client. We are fixing this by passing two additional arguments to the `assembleDepositTransaction` function - `network` and `fee`. We are also making sure that we pass the arguments in the correct order.
Refs: #695.
This PR replaces the
bcoin
library withbitcoinjs-lib
for deposits. The functions generally works in the same way as before the change.One difference is that UTXOs for funding the transaction and the value of fee are passed into the function as arguments.
In the future, we could consider using coinselect for calculating fee and selecting UTXOs.
Another difference is that only one type of funding UTXO is allowed (P2WPKH). Other types should be added along with unit tests.