Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1865: withdrawals as part of the coin selection r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #1861 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - 12b28f7 📍 **take withdrawals into account, one level earlier, during the coin selection** Still to be done: - Make sure it's correctly done in the largest-first algorithm - Add some test scenario that show the influence of the withdrawal - 547b130 📍 **unit-test the newly introduced 'proportionallyTo'** Getting this one wrong would be quite bad :s - 975f726 📍 **add unit tests showing how withdrawal impacts the random coin selection** > 💡 NOTE > > I've chosen not to treat the withdrawal as a single _input_, but more as a "money pot" that is proportionally distributed amongst change output, so that it contributes to every output, based on their size. This is to avoid having a small output consuming the entire withdrawal for itself. Note sure if I'll keep the approach in the end, I'll have the night to think about it. # Comments <!-- Additional comments or screenshots to attach if any --> - [ ] TODO: take into account the withdrawal when doing largest-first (and testing it) - [ ] TODO: echo the error message change on "ErrInputsDepleted" to integration tests relying on that message. <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <matthias.benkort@gmail.com>
- Loading branch information
Showing
16 changed files
with
375 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.