Don't use is_available() for HW wallets
is_available() is only used from generic code for non-hardware wallets. Having a local function of the same name is confusing.
This commit is contained in:
@@ -165,19 +165,16 @@ class TrezorCompatiblePlugin(BasePlugin):
|
||||
self.print_error(message)
|
||||
raise Exception(message)
|
||||
|
||||
def is_available(self):
|
||||
if not self.libraries_available:
|
||||
return False
|
||||
if not self.wallet:
|
||||
return False
|
||||
wallet_type = self.wallet.storage.get('wallet_type')
|
||||
return wallet_type == self.wallet_class.wallet_type
|
||||
|
||||
def set_enabled(self, enabled):
|
||||
self.wallet.storage.put('use_' + self.name, enabled)
|
||||
|
||||
def is_enabled(self):
|
||||
if not self.is_available():
|
||||
if not self.libraries_available:
|
||||
return False
|
||||
if not self.wallet:
|
||||
return False
|
||||
wallet_type = self.wallet_class.wallet_type
|
||||
if self.wallet.storage.get('wallet_type') != wallet_type:
|
||||
return False
|
||||
if self.wallet.has_seed():
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user