Implement setup, wipe, restore, and backup commands for Ledger

Ledger does not support these via software, so just raise errors
This commit is contained in:
Andrew Chow 2018-12-29 00:10:47 -05:00
parent 0fd460853e
commit ca17a85e7d

View File

@ -1,6 +1,6 @@
# Ledger interaction script
from ..hwwclient import HardwareWalletClient
from ..hwwclient import HardwareWalletClient, UnavailableActionError
from btchip.btchip import *
from btchip.btchipUtils import *
import base64
@ -249,19 +249,19 @@ class LedgerClient(HardwareWalletClient):
# Setup a new device
def setup_device(self, label='', passphrase=''):
raise NotImplementedError('The Ledger Nano S does not support software setup')
raise UnavailableActionError('The Ledger Nano S does not support software setup')
# Wipe this device
def wipe_device(self):
raise NotImplementedError('The Ledger Nano S does not support wiping via software')
raise UnavailableActionError('The Ledger Nano S does not support wiping via software')
# Restore device from mnemonic or xprv
def restore_device(self, label=''):
raise NotImplementedError('The Ledger Nano S does not implement device restoring')
raise UnavailableActionError('The Ledger Nano S does not support restoring via software')
# Begin backup process
def backup_device(self, label='', passphrase=''):
raise NotImplementedError('The Ledger Nano S does not implement this method')
raise UnavailableActionError('The Ledger Nano S does not support creating a backup via software')
# Close the device
def close(self):