-
Notifications
You must be signed in to change notification settings - Fork 14
fix: simple transaction do not have any 4 inputs limitation #158
Conversation
This is not anymore the definition of a simpleTransaction
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.
typo
Co-authored-by: Cofresi <cofresi@dash.org>
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.
Concept ACK
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.
👍
Co-authored-by: thephez <thephez@users.noreply.github.com>
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.
Looks good )
@@ -331,7 +331,7 @@ describe('Utils - coinSelection', function suite() { | |||
|
|||
while(inputValue<outputValue){ | |||
if(copiedUtxos.length === 0){ | |||
throw new Error('Not enought utxo'); | |||
throw new Error('Not enought 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.
Oops, missed this the first time 🙈
throw new Error('Not enought UTXOs'); | |
throw new Error('Not enough 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.
It's already merged, but I do will update that on another PR, I've taken note of it on my todo :) Thank you :)
Issue being fixed or feature implemented
As reported in #157, the SimpleTransactionOptimizedAccumulator strategy was optimising for a maximum of 4 inputs to ensure they get locked. By default, this was the transaction strategy that were being used, so anyone that will try to spend using default options would encounter that case (if using small inputs), and the documentation would not explained the why.
As this rules actually is not in place anymore, we can safely modify the strategy to not put this limitation anymore.
What was done?
How Has This Been Tested?
Rely on differents UTXO selection test we have + additional test in coinSelection file (was already tested in Account.createTransaction)
Breaking Changes
N/A (but won't cause the issue again)
Checklist: