Skip to content

Commit

Permalink
fix pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tarakby committed Nov 2, 2024
1 parent df1302d commit f5a3a2e
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tests/application_client/flow_command_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def get_slot(self, slot: int) -> RAPDU:

@contextmanager
def set_slot(
*,
self,
slot: int,
address: str,
Expand Down Expand Up @@ -225,6 +226,7 @@ def get_public_key_with_confirmation(

@contextmanager
def sign_tx(
*,
self,
path: str,
curve: CurveChoice,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions tests/test_sign_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _check_transaction(
message = bytes.fromhex(transaction)

# Send the APDU (Asynchronous)
with client.sign_tx(path, curve, message, hash_t, signable_type):
with client.sign_tx(path=path, curve=curve, transaction=message, hash_t=hash_t, hint=signable_type):
util_navigate(firmware, navigator, test_name, "APPROVE_SIGN", timeout)

# Send the APDU (Asynchronous)
Expand Down Expand Up @@ -335,7 +335,7 @@ def test_transaction_refused(firmware, backend, navigator, test_name):

# Send the APDU (Asynchronous)
with pytest.raises(ExceptionRAPDU) as err:
with client.sign_tx(path, curve, message, hash_t, scriptHash):
with client.sign_tx(path=path, curve=curve, transaction=message, hash_t=hash_t, hint=scriptHash):
util_navigate(firmware, navigator, test_name, "REJECT_SIGN")

# Assert we have received a refusal
Expand Down Expand Up @@ -443,7 +443,7 @@ def test_message_invalid(self, firmware, backend, navigator, test_name):

# Send the APDU (Asynchronous)
with pytest.raises(ExceptionRAPDU) as err:
with client.sign_tx(path, cfg["curve"], message, cfg["hash"], "message"):
with client.sign_tx(path=path, curve=cfg["curve"], transaction=message, hash_t=cfg["hash"], hint="message"):
pass
assert(str(err) == "<ExceptionInfo ExceptionRAPDU(status=27012, data=b'Invalid message') tblen=8>")
part += 1
Expand All @@ -466,7 +466,7 @@ def test_arbitrary_transaction_signing_fail_in_no_expert_mode(self, firmware, ba
part = 0
# Send the APDU and check the results
with pytest.raises(ExceptionRAPDU) as err:
with client.sign_tx(path, cfg["curve"], bytes.fromhex(cfg["tx"]), cfg["hash"], "arbitrary"):
with client.sign_tx(path=path, curve=cfg["curve"], transaction=bytes.fromhex(cfg["tx"]), hash_t=cfg["hash"], hint="arbitrary"):
pass
assert(str(err) == "<ExceptionInfo ExceptionRAPDU(status=27012, data=b'Unexpected script') tblen=8>")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_slots.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_get_slot_refused(firmware, backend, navigator, test_name):

# Send the APDU (Asynchronous)
with pytest.raises(ExceptionRAPDU) as err:
with client.set_slot(slot, address, path, curve, hash_t):
with client.set_slot(slot=slot, address=address, path=path, curve=curve, hash_t=hash_t):
util_navigate(firmware, navigator, test_name, "REJECT_SLOT")

# Assert we have received a refusal
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def util_set_slot(
""" Function to Set Slot parameters """

# Send the APDU (Asynchronous)
with client.set_slot(slot, address, path, curve, hash_t):
with client.set_slot(slot=slot, address=address, path=path, curve=curve, hash_t=hash_t):
util_navigate(firmware, navigator, test_name, "APPROVE_SLOT")

# Check the status (Asynchronous)
Expand Down

0 comments on commit f5a3a2e

Please sign in to comment.