From a9c4c344eca209ed4a13dcad93eaa7c4602e20e7 Mon Sep 17 00:00:00 2001 From: chloefeal <188809157+chloefeal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:27:31 +0800 Subject: [PATCH 1/2] errors: fix typos Signed-off-by: chloefeal <188809157+chloefeal@users.noreply.github.com> --- hwilib/devices/ledger_bitcoin/errors.py | 4 ++-- hwilib/errors.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hwilib/devices/ledger_bitcoin/errors.py b/hwilib/devices/ledger_bitcoin/errors.py index e1812844e..0c2e046b0 100644 --- a/hwilib/devices/ledger_bitcoin/errors.py +++ b/hwilib/devices/ledger_bitcoin/errors.py @@ -42,7 +42,7 @@ NO_DEVICE_TYPE = -1 #: Device type was not specified MISSING_ARGUMENTS = -2 #: Arguments are missing DEVICE_CONN_ERROR = -3 #: Error connecting to the device -UNKNWON_DEVICE_TYPE = -4 #: Device type is unknown +UNKNOWN_DEVICE_TYPE = -4 #: Device type is unknown INVALID_TX = -5 #: Transaction is invalid NO_PASSWORD = -6 #: No password provided, but one is needed BAD_ARGUMENT = -7 #: Bad, malformed, or conflicting argument was provided @@ -161,7 +161,7 @@ def __init__(self, msg: str): """ :param msg: The error message """ - HWWError.__init__(self, msg, UNKNWON_DEVICE_TYPE) + HWWError.__init__(self, msg, UNKNOWN_DEVICE_TYPE) class NotImplementedError(HWWError): """ diff --git a/hwilib/errors.py b/hwilib/errors.py index 1f8c9195d..c3c19b6c4 100644 --- a/hwilib/errors.py +++ b/hwilib/errors.py @@ -16,7 +16,7 @@ NO_DEVICE_TYPE = -1 #: Device type was not specified MISSING_ARGUMENTS = -2 #: Arguments are missing DEVICE_CONN_ERROR = -3 #: Error connecting to the device -UNKNWON_DEVICE_TYPE = -4 #: Device type is unknown +UNKNOWN_DEVICE_TYPE = -4 #: Device type is unknown INVALID_TX = -5 #: Transaction is invalid NO_PASSWORD = -6 #: No password provided, but one is needed BAD_ARGUMENT = -7 #: Bad, malformed, or conflicting argument was provided @@ -128,7 +128,7 @@ def __init__(self, msg: str): """ :param msg: The error message """ - HWWError.__init__(self, msg, UNKNWON_DEVICE_TYPE) + HWWError.__init__(self, msg, UNKNOWN_DEVICE_TYPE) class NotImplementedError(HWWError): """ From 33c43eb3e1939b9c30aed2ee164d35b0269ac712 Mon Sep 17 00:00:00 2001 From: chloefeal <188809157+chloefeal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:27:50 +0800 Subject: [PATCH 2/2] devices: fix typos Signed-off-by: chloefeal <188809157+chloefeal@users.noreply.github.com> --- hwilib/devices/ckcc/client.py | 4 ++-- hwilib/devices/ckcc/protocol.py | 2 +- hwilib/devices/jadepy/jade.py | 2 +- hwilib/devices/ledger.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hwilib/devices/ckcc/client.py b/hwilib/devices/ckcc/client.py index 1f265fb25..419fdb826 100644 --- a/hwilib/devices/ckcc/client.py +++ b/hwilib/devices/ckcc/client.py @@ -171,8 +171,8 @@ def send_recv(self, msg, expect_errors=False, verbose=0, timeout=3000, encrypt=T raise def ec_setup(self): - # Provides the ECSDA primatives in portable way. - # Needed to do D-H session key aggreement and then AES. + # Provides the ECSDA primitives in portable way. + # Needed to do D-H session key agreement and then AES. # - should be replaced in subclasses if you have other EC libraries # - curve is always secp256k1 # - values are binary strings diff --git a/hwilib/devices/ckcc/protocol.py b/hwilib/devices/ckcc/protocol.py index 92431910e..9f18db441 100644 --- a/hwilib/devices/ckcc/protocol.py +++ b/hwilib/devices/ckcc/protocol.py @@ -63,7 +63,7 @@ def check_mitm(): @staticmethod def start_backup(): - # prompts user with password for encrytped backup + # prompts user with password for encrypted backup return b'back' @staticmethod diff --git a/hwilib/devices/jadepy/jade.py b/hwilib/devices/jadepy/jade.py index 2c8f4a3ce..58f31d0a5 100644 --- a/hwilib/devices/jadepy/jade.py +++ b/hwilib/devices/jadepy/jade.py @@ -485,7 +485,7 @@ def ota_update(self, fwcmp, fwlen, chunksize, fwhash=None, patchlen=None, cb=Non ack'd by the hw, to notify of upload progress. Defaults to None, and nothing is called to report upload progress. extended_replies: bool, optional - If set Jade may return addtional progress data with each data chunk uploaded, which is + If set Jade may return additional progress data with each data chunk uploaded, which is then passed to any progress callback as above. If not no additional data is returned or passed. diff --git a/hwilib/devices/ledger.py b/hwilib/devices/ledger.py index d3cf46325..dd1273f08 100644 --- a/hwilib/devices/ledger.py +++ b/hwilib/devices/ledger.py @@ -217,7 +217,7 @@ def legacy_sign_tx() -> PSBT: return legacy_sign_tx() # Make a deepcopy of this psbt. We will need to modify it to get signing to work, - # which will affect the caller's detection for whether signing occured. + # which will affect the caller's detection for whether signing occurred. psbt2 = copy.deepcopy(tx) if tx.version != 2: psbt2.convert_to_v2()