-
Notifications
You must be signed in to change notification settings - Fork 82
added ability to define which utxos to use #61
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
added ability to define which utxos to use #61
Conversation
4297566 to
f3b9175
Compare
Codecov Report
@@ Coverage Diff @@
## master #61 +/- ##
==========================================
+ Coverage 93.56% 93.61% +0.04%
==========================================
Files 33 33
Lines 1835 1848 +13
Branches 255 257 +2
==========================================
+ Hits 1717 1730 +13
Misses 112 112
Partials 6 6
Continue to review full report at Codecov.
|
rkalis
left a comment
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 so far @maikelmclauflin, thanks a lot for picking up this issue!
I highlighted a few points in the review, but overall really nice work.
| _utxos?: Utxo[], | ||
| ): Promise<{ inputs: Utxo[], outputs: OutputForBuilder[] }> { | ||
| const { utxos } = await this.bitbox.Address.utxo(this.address) as AddressUtxoResult; | ||
| let utxos = _utxos; |
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.
So when someone passes in their own list of inputs, all of them should be used. I think that with this code change, it only replaces the "pool" of possible UTXOs, but then it still performs the UTXO selection algorithm below. This means that some of the manual inputs might get excluded due to the selection process.
So instead, if a manual list of utxos is provided, this should completely replace the "selection process". But it should still add a change output where necessary, and it should also check that the provided UTXOs are enough to cover the transaction. Does that make sense?
- Allow unconfirmed UTXOs to be used - Replace `total` with `amount` for "happy case" test - Add type annotation for gatherUtxos parameter
5797d17 to
9498caa
Compare
9498caa to
d38a9c3
Compare
|
I'm planning to change the Transaction send interface around, so I'll merge this change in, and make some changes to fit in the new interface. |
fixes #44