For Yoroi the Send screen allows the user to author a transaction. Once they've specified the receiver and the amount, they can press the "send" button to broadcast the transaction.
They way I would like this to work internally (currently it's a big hack job) is that the Send page creates a Transaction and when they press the "send" button it tries to create a SignedTransaction. The problem is that creating a SignedTransaction frees the original Transaction object so it's not easy to provide a fallback if a tx fails. The cleanest way to solve this is when you press the "send" button, it clones the transaction and tries to sign the clone. If signing fails, it falls back to the original Transaction.
I also added from_json in here since probably this will be useful for unit tests once I finish this part of Yoroi refactoring.
For Yoroi the Send screen allows the user to author a transaction. Once they've specified the receiver and the amount, they can press the "send" button to broadcast the transaction.
They way I would like this to work internally (currently it's a big hack job) is that the Send page creates a
Transaction
and when they press the "send" button it tries to create aSignedTransaction
. The problem is that creating aSignedTransaction
frees the originalTransaction
object so it's not easy to provide a fallback if a tx fails. The cleanest way to solve this is when you press the "send" button, it clones the transaction and tries to sign the clone. If signing fails, it falls back to the originalTransaction
.I also added
from_json
in here since probably this will be useful for unit tests once I finish this part of Yoroi refactoring.