don't allow multiple outputs on TXN fees#142
Conversation
fix for TOK-387 Signed-off-by: Devin Fisher <devin.fisher@evernym.com>
There was a problem hiding this comment.
This looks good to me but a quick non-blocking question: Has the todo in https://github.com/evernym/plugin/pull/142/files#diff-8b0c45456d245ad53d1b31121aaf4a48R111 been resolved?
|
I don't know. I would have to look into it. |
| if len(outputs) > MAX_FEE_OUTPUTS: | ||
| raise InvalidClientRequest(request.identifier, | ||
| request.reqId, | ||
| "Only {} OUTPUT is allow for Transaction fees".format(MAX_FEE_OUTPUTS)) |
There was a problem hiding this comment.
That would be a good change
| change_address = [change_address] | ||
| change_part = change // len(change_address) | ||
| if change_part <= 0: | ||
| raise Exception("Unable to divide {}, {} ways".format(change, len(change_address))) |
There was a problem hiding this comment.
I don't see how this exception will be reached. Len will never be less than 0, and this is under an if block that enforces the change to be greater than 0. So the change_part will never be negative and won't run.
There was a problem hiding this comment.
I can only happen if the fee is lower then the number of output addresses.
There was a problem hiding this comment.
Okay. I see it now. That's weird. Thanks.
| req, | ||
| utxos, | ||
| fee_amount, | ||
| change_address=[address_main, Address().address] |
There was a problem hiding this comment.
Use helpers.wallet.create_address rather than the Address class directly. Otherwise the signing should fail.
There was a problem hiding this comment.
Did not know about that. That would be a good improvement.
fix for TOK-387
Signed-off-by: Devin Fisher devin.fisher@evernym.com