-
Notifications
You must be signed in to change notification settings - Fork 177
fix(wallet): adds utxo selection to manual spend on wallet interface #223
fix(wallet): adds utxo selection to manual spend on wallet interface #223
Conversation
Not sure how we want to handle since this isn't really blocking, but I found a small bug where the address level checkbox is deselected when you navigate back to edit a transaction To reproduce:
What could be blocking though is that I selected only 1/2 of the UTXOs from an address however when going back it looks like both are selected. If this is the case and can be confirmed, I'd say this is blocking since we don't want someone accidentally spending all the UTXOs when they only meant to spend part. |
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.
Couple of small comments on the code as is, but I think we should address the issue when you go back to edit after clicking to sign
setInputs(inputsToSpend); | ||
let totalInputsToSpend = inputsToSpend; | ||
|
||
// The following is only relevant on the wallet interface |
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.
🤦
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.
Even worse that we have to do this multiple times in the same method
if (numLocalInputsToSpend === 0) { | ||
setSpendCheckbox(false); | ||
} else if ( | ||
numLocalInputsToSpend >= 1 && |
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.
Don't think you need the >=1
here
numLocalInputsToSpend >= 1 && | |
numLocalInputsToSpend && |
This is also the case if you navigate away from the send tab (by going to the addresses or receive tab, for example). When you come back you end up in the same state as shown in the screenshot. |
I updated things to make sure that it at least shows that the address is now selected (full checkbox, not indeterminate or missing) when you navigate away and/or click edit transaction. It will require more effort given the current design to actually save which inputs were selected. It would be easier with a larger refactor of how the application is structured. |
Don't know if this needs to be a blocker, but this was a weird little bug. If there's only one UTXO in an address, selecting it in the utxo selector doesn't work: utxo-select.mp4 |
Tested happy path and the reset of the utxos if going back to edit and it all seems to work other than the bug identified above. If that is easily fixable, then it'd be good if we can get that in (maybe just disabling that view if only one utxo as a quick fix? 🤷♂️ ). Otherwise it LGTM! |
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.
Confirmed it works! 👏 🎉
Description
Allow UTXO selection on manual spend in Wallet interface.
Does this PR introduce a breaking change?
Does this PR fix an open issue?
Fixes #54
Follow-up to #221 - adds in the necessary logic to handle utxo selection across multiple addresses