[electrum] handle the password cancellation more gracefully
Summary:
When creating a proof from a coin selected in the Coins tab, the proof editor opens and immediately tries to add the coins to the proof. If the wallet is encrypted, the self.pwd
property of AvaProofEditor will pop up a password dialog. If that dialog is cancelled, the pwd property will be None which will cause some exotic Base58 decoding error to by shown to users when calling self.wallet.export_private_key(address, self.pwd).
So we need to exit early from add_utxos if the password is not available and show an error message that makes more sense..
Test Plan:
With an encrypted wallet, select one or more coins in the coins tab, right click and "Build avalanche proof". Cancel the password dialog twice (the first time when the the dialog tries to suggest a master private key, the second time when the dialog tries again to get the password to get the coin's private keys).
A helpful error message is shown and the proof editor opens with neither master key nor stakes. Try again adding coins from this wallet in the proof editor, and get the same result if you cancel the password dialog again.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D15040