mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 17:55:20 +00:00
Clean up messages about msg signing/verification.
Allow translations. Test is_mine before txin_type. Show txin_type in msg.
This commit is contained in:
parent
563aae0dbd
commit
99a08f35b2
1 changed files with 10 additions and 8 deletions
|
@ -2017,24 +2017,26 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
d.setLayout(vbox)
|
d.setLayout(vbox)
|
||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
msg_sign = ("Signing with an address actually means signing with the corresponding "
|
msg_sign = _("Signing with an address actually means signing with the corresponding "
|
||||||
"private key, and verifying with the corresponding public key. The "
|
"private key, and verifying with the corresponding public key. The "
|
||||||
"address you have entered does not have a unique public key, so these "
|
"address you have entered does not have a unique public key, so these "
|
||||||
"operations cannot be performed.")
|
"operations cannot be performed.") + '\n\n' + \
|
||||||
|
_('The operation is undefined. Not just in Electrum, but in general.')
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
def do_sign(self, address, message, signature, password):
|
def do_sign(self, address, message, signature, password):
|
||||||
address = address.text().strip()
|
address = address.text().strip()
|
||||||
message = message.toPlainText().strip()
|
message = message.toPlainText().strip()
|
||||||
if not bitcoin.is_address(address):
|
if not bitcoin.is_address(address):
|
||||||
self.show_message('Invalid Bitcoin address.')
|
self.show_message(_('Invalid Bitcoin address.'))
|
||||||
|
return
|
||||||
|
if not self.wallet.is_mine(address):
|
||||||
|
self.show_message(_('Address not in wallet.'))
|
||||||
return
|
return
|
||||||
txin_type = self.wallet.get_txin_type(address)
|
txin_type = self.wallet.get_txin_type(address)
|
||||||
if txin_type not in ['p2pkh', 'p2wpkh', 'p2wpkh-p2sh']:
|
if txin_type not in ['p2pkh', 'p2wpkh', 'p2wpkh-p2sh']:
|
||||||
self.show_message('Cannot sign messages with this type of address.' + '\n\n' + self.msg_sign)
|
self.show_message(_('Cannot sign messages with this type of address:') + \
|
||||||
return
|
' ' + txin_type + '\n\n' + self.msg_sign)
|
||||||
if not self.wallet.is_mine(address):
|
|
||||||
self.show_message('Address not in wallet.')
|
|
||||||
return
|
return
|
||||||
task = partial(self.wallet.sign_message, address, message, password)
|
task = partial(self.wallet.sign_message, address, message, password)
|
||||||
|
|
||||||
|
@ -2046,7 +2048,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
address = address.text().strip()
|
address = address.text().strip()
|
||||||
message = message.toPlainText().strip().encode('utf-8')
|
message = message.toPlainText().strip().encode('utf-8')
|
||||||
if not bitcoin.is_address(address):
|
if not bitcoin.is_address(address):
|
||||||
self.show_message('Invalid Bitcoin address.')
|
self.show_message(_('Invalid Bitcoin address.'))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
# This can throw on invalid base64
|
# This can throw on invalid base64
|
||||||
|
|
Loading…
Add table
Reference in a new issue