From c33c243b788fbb6870a4d57639d6e5a64750aef4 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Fri, 6 Sep 2024 12:27:09 +0200 Subject: [PATCH 1/4] Skip `LedgerSigner` tests --- .../tests/unit/signer/test_ledger_signer.py | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/starknet_py/tests/unit/signer/test_ledger_signer.py b/starknet_py/tests/unit/signer/test_ledger_signer.py index ff38fec54..8f3a58c4f 100644 --- a/starknet_py/tests/unit/signer/test_ledger_signer.py +++ b/starknet_py/tests/unit/signer/test_ledger_signer.py @@ -20,11 +20,8 @@ from starknet_py.tests.e2e.fixtures.misc import load_contract -# TODO (#1425): Currently Ledger tests are skipped on Windows due to different Speculos setup. -@pytest.mark.skipif( - platform == "win32", - reason="Testing Ledger is skipped on Windows due to different Speculos setup.", -) +# TODO (#1476): Should be enabled once Ledger signer is updated with new APDU spec. +@pytest.mark.skip def test_init_with_invalid_derivation_path(): with pytest.raises(ValueError, match="Empty derivation path"): LedgerSigner(derivation_path_str="", chain_id=StarknetChainId.SEPOLIA) @@ -81,10 +78,8 @@ def test_init_with_invalid_derivation_path(): ), ], ) -@pytest.mark.skipif( - platform == "win32", - reason="Testing Ledger is skipped on Windows due to different Speculos setup.", -) +# TODO (#1476): Should be enabled once Ledger signer is updated with new APDU spec. +@pytest.mark.skip def test_sign_transaction(transaction): # docs: start @@ -104,10 +99,8 @@ def test_sign_transaction(transaction): assert all(i != 0 for i in signature) -@pytest.mark.skipif( - platform == "win32", - reason="Testing Ledger is skipped on Windows due to different Speculos setup.", -) +# TODO (#1476): Should be enabled once Ledger signer is updated with new APDU spec. +@pytest.mark.skip def test_create_account_with_ledger_signer(): # pylint: disable=unused-variable signer = LedgerSigner( @@ -141,10 +134,8 @@ async def _get_account_balance_strk(client: FullNodeClient, address: int): @pytest.mark.asyncio -@pytest.mark.skipif( - platform == "win32", - reason="Testing Ledger is skipped on Windows due to different Speculos setup.", -) +# TODO (#1476): Should be enabled once Ledger signer is updated with new APDU spec. +@pytest.mark.skip async def test_deploy_account_and_transfer(client): signer = LedgerSigner( derivation_path_str="m/2645'/1195502025'/1470455285'/0'/0'/0", From b42debdff384d270073965f191921df724e40100 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Fri, 6 Sep 2024 12:35:08 +0200 Subject: [PATCH 2/4] Update skip reason --- starknet_py/tests/unit/signer/test_ledger_signer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/starknet_py/tests/unit/signer/test_ledger_signer.py b/starknet_py/tests/unit/signer/test_ledger_signer.py index 8f3a58c4f..a62bd52fd 100644 --- a/starknet_py/tests/unit/signer/test_ledger_signer.py +++ b/starknet_py/tests/unit/signer/test_ledger_signer.py @@ -20,7 +20,7 @@ from starknet_py.tests.e2e.fixtures.misc import load_contract -# TODO (#1476): Should be enabled once Ledger signer is updated with new APDU spec. +# TODO (#1476): Should be re-enabled once Ledger signer is updated with new APDU spec. @pytest.mark.skip def test_init_with_invalid_derivation_path(): with pytest.raises(ValueError, match="Empty derivation path"): @@ -78,7 +78,7 @@ def test_init_with_invalid_derivation_path(): ), ], ) -# TODO (#1476): Should be enabled once Ledger signer is updated with new APDU spec. +# TODO (#1476): Should be re-enabled once Ledger signer is updated with new APDU spec. @pytest.mark.skip def test_sign_transaction(transaction): # docs: start @@ -99,7 +99,7 @@ def test_sign_transaction(transaction): assert all(i != 0 for i in signature) -# TODO (#1476): Should be enabled once Ledger signer is updated with new APDU spec. +# TODO (#1476): Should be re-enabled once Ledger signer is updated with new APDU spec. @pytest.mark.skip def test_create_account_with_ledger_signer(): # pylint: disable=unused-variable @@ -134,7 +134,7 @@ async def _get_account_balance_strk(client: FullNodeClient, address: int): @pytest.mark.asyncio -# TODO (#1476): Should be enabled once Ledger signer is updated with new APDU spec. +# TODO (#1476): Should be re-enabled once Ledger signer is updated with new APDU spec. @pytest.mark.skip async def test_deploy_account_and_transfer(client): signer = LedgerSigner( From e96674be2fdd017be877f5baf1193219fe5bbcfc Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Fri, 6 Sep 2024 12:38:08 +0200 Subject: [PATCH 3/4] Remove unused import --- starknet_py/tests/unit/signer/test_ledger_signer.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/starknet_py/tests/unit/signer/test_ledger_signer.py b/starknet_py/tests/unit/signer/test_ledger_signer.py index a62bd52fd..daef9dfa9 100644 --- a/starknet_py/tests/unit/signer/test_ledger_signer.py +++ b/starknet_py/tests/unit/signer/test_ledger_signer.py @@ -1,5 +1,3 @@ -from sys import platform - import pytest from starknet_py.common import create_sierra_compiled_contract From fcb568530ea5df4431be440f988657c635da16bd Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Fri, 6 Sep 2024 12:43:25 +0200 Subject: [PATCH 4/4] Update directory while building docker Starknet ledger app --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index b7c4391e9..69161a638 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -196,7 +196,7 @@ jobs: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools options: --rm -v ${{ github.workspace }}:/apps run: | - cd /apps/app-starknet + cd /apps/app-starknet/starknet cargo clean cargo ledger build nanox