Adapt test to provide certificate APDU

This commit is contained in:
Charles-Edouard de la Vergne
2024-06-11 10:59:14 +02:00
parent 1a555d0996
commit 338f7cef45
4 changed files with 5 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ disable = C0114, # missing-module-docstring
R0912, # too-many-branches R0912, # too-many-branches
R0913, # too-many-arguments R0913, # too-many-arguments
R0914, # too-many-locals R0914, # too-many-locals
R0915, # too-many-statements
W0603, # global-statement W0603, # global-statement
E0401 # import-error E0401 # import-error
extension-pkg-whitelist=hid extension-pkg-whitelist=hid

View File

@@ -34,6 +34,7 @@ def common(firmware: Firmware, app_client: EthAppClient) -> int:
if firmware == Firmware.NANOS: if firmware == Firmware.NANOS:
pytest.skip("Not supported on LNS") pytest.skip("Not supported on LNS")
challenge = app_client.get_challenge() challenge = app_client.get_challenge()
return ResponseParser.challenge(challenge.data) return ResponseParser.challenge(challenge.data)

View File

@@ -5,7 +5,6 @@ from ragger.backend import BackendInterface
from client.client import EthAppClient, StatusWord from client.client import EthAppClient, StatusWord
def test_provide_erc20_token(backend: BackendInterface): def test_provide_erc20_token(backend: BackendInterface):
app_client = EthAppClient(backend) app_client = EthAppClient(backend)
@@ -21,7 +20,7 @@ def test_provide_erc20_token_error(backend: BackendInterface):
addr = bytes.fromhex("e41d2489571d322189246dafa5ebde1f4699f498") addr = bytes.fromhex("e41d2489571d322189246dafa5ebde1f4699f498")
sign = bytes.fromhex("deadbeef") sign = bytes.fromhex("deadbeef")
with pytest.raises(ExceptionRAPDU) as e: with pytest.raises(ExceptionRAPDU) as err:
app_client.provide_token_metadata("ZRX", addr, 18, 1, sign) app_client.provide_token_metadata("ZRX", addr, 18, 1, sign)
assert e.value.status == StatusWord.INVALID_DATA assert err.value.status == StatusWord.INVALID_DATA

View File

@@ -70,6 +70,7 @@ def common_test_nft(firmware: Firmware,
collec.addr, collec.addr,
get_selector_from_data(data), get_selector_from_data(data),
collec.chain_id) collec.chain_id)
app_client.provide_nft_metadata(collec.name, collec.addr, collec.chain_id) app_client.provide_nft_metadata(collec.name, collec.addr, collec.chain_id)
tx_params = { tx_params = {
"nonce": NONCE, "nonce": NONCE,