Hardware wallets don't have seeds
This commit is contained in:
@@ -70,6 +70,7 @@ class BTChipWallet(BIP32_HD_Wallet):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def is_watching_only(self):
|
def is_watching_only(self):
|
||||||
|
assert not self.has_seed()
|
||||||
return self.force_watching_only
|
return self.force_watching_only
|
||||||
|
|
||||||
def get_client(self, noPin=False):
|
def get_client(self, noPin=False):
|
||||||
@@ -206,8 +207,6 @@ class BTChipWallet(BIP32_HD_Wallet):
|
|||||||
self.give_error("Not supported")
|
self.give_error("Not supported")
|
||||||
|
|
||||||
def sign_message(self, address, message, password):
|
def sign_message(self, address, message, password):
|
||||||
if self.has_seed():
|
|
||||||
return BIP32_HD_Wallet.sign_message(self, address, message, password)
|
|
||||||
use2FA = False
|
use2FA = False
|
||||||
self.signing = True
|
self.signing = True
|
||||||
self.get_client() # prompt for the PIN before displaying the dialog if necessary
|
self.get_client() # prompt for the PIN before displaying the dialog if necessary
|
||||||
@@ -258,8 +257,6 @@ class BTChipWallet(BIP32_HD_Wallet):
|
|||||||
return chr(27 + 4 + (signature[0] & 0x01)) + r + s
|
return chr(27 + 4 + (signature[0] & 0x01)) + r + s
|
||||||
|
|
||||||
def sign_transaction(self, tx, password):
|
def sign_transaction(self, tx, password):
|
||||||
if self.has_seed():
|
|
||||||
return BIP32_HD_Wallet.sign_transaction(self, tx, password)
|
|
||||||
if tx.is_complete():
|
if tx.is_complete():
|
||||||
return
|
return
|
||||||
self.signing = True
|
self.signing = True
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class TrezorCompatibleWallet(BIP44_Wallet):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def is_watching_only(self):
|
def is_watching_only(self):
|
||||||
|
assert not self.has_seed()
|
||||||
return not self.proper_device
|
return not self.proper_device
|
||||||
|
|
||||||
def can_change_password(self):
|
def can_change_password(self):
|
||||||
@@ -68,8 +69,6 @@ class TrezorCompatibleWallet(BIP44_Wallet):
|
|||||||
raise RuntimeError(_('Decrypt method is not implemented'))
|
raise RuntimeError(_('Decrypt method is not implemented'))
|
||||||
|
|
||||||
def sign_message(self, address, message, password):
|
def sign_message(self, address, message, password):
|
||||||
if self.has_seed():
|
|
||||||
return BIP32_HD_Wallet.sign_message(self, address, message, password)
|
|
||||||
self.check_proper_device()
|
self.check_proper_device()
|
||||||
try:
|
try:
|
||||||
address_path = self.address_id(address)
|
address_path = self.address_id(address)
|
||||||
@@ -88,8 +87,6 @@ class TrezorCompatibleWallet(BIP44_Wallet):
|
|||||||
def sign_transaction(self, tx, password):
|
def sign_transaction(self, tx, password):
|
||||||
if tx.is_complete() or self.is_watching_only():
|
if tx.is_complete() or self.is_watching_only():
|
||||||
return
|
return
|
||||||
if self.has_seed():
|
|
||||||
return BIP32_HD_Wallet.sign_transaction(self, tx, password)
|
|
||||||
self.check_proper_device()
|
self.check_proper_device()
|
||||||
# previous transactions used as inputs
|
# previous transactions used as inputs
|
||||||
prev_tx = {}
|
prev_tx = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user