Browse Source

hw bitbox02: show error if trying to sign_message on testnet

User was getting confusing traceback.
Original discussion shows the device only supports messages for mainnet.

see https://github.com/spesmilo/electrum/pull/6649#issuecomment-708634831
master
SomberNight 3 years ago
parent
commit
8878059b2f
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/plugins/bitbox02/bitbox02.py

4
electrum/plugins/bitbox02/bitbox02.py

@ -577,6 +577,10 @@ class BitBox02_KeyStore(Hardware_KeyStore):
) )
def sign_message(self, sequence, message, password, *, script_type=None): def sign_message(self, sequence, message, password, *, script_type=None):
if constants.net.TESTNET:
raise UserFacingException(
_("The {} only supports message signing on mainnet.").format(self.device)
)
if password: if password:
raise Exception("BitBox02 does not accept a password from the host") raise Exception("BitBox02 does not accept a password from the host")
client = self.get_client() client = self.get_client()

Loading…
Cancel
Save