Skip to content

Commit d972124

Browse files
Use previous Ledger app version and re-enable Ledger signer tests (#1487)
* Use `main` branch for `app-starknet`; Re-enable ledger signer tests * Use commit SHA instead of branch name * Add `cd` command * Perform `git checkout` in building app step * Remove unnecessary change in clone command * Update ledger signer docs
1 parent fcf48c3 commit d972124

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

.github/workflows/checks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ env:
44
CAIRO_LANG_VERSION: "0.13.1"
55
DEVNET_VERSION: "0.1.2"
66
DEVNET_SHA: 7e7dbb5
7+
LEDGER_APP_SHA: dd58c5c
78

89
on:
910
push:
@@ -196,7 +197,8 @@ jobs:
196197
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools
197198
options: --rm -v ${{ github.workspace }}:/apps
198199
run: |
199-
cd /apps/app-starknet/starknet
200+
cd /apps/app-starknet
201+
git checkout ${{ env.LEDGER_APP_SHA }}
200202
cargo clean
201203
cargo ledger build nanox
202204

docs/guide/signing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ signing algorithm, it is possible to create ``Account`` with custom
1515
Signing with Ledger
1616
-------------------
1717
:ref:`LedgerSigner` allows you to sign transactions using a Ledger device. The device must be unlocked and Starknet app needs to be open.
18+
Currently used version of Starknet app is ``1.1.1`` and only blind-signing is possible. Clear-signing will be available in the near future.
1819

1920
.. codesnippet:: ../../starknet_py/tests/unit/signer/test_ledger_signer.py
2021
:language: python

starknet_py/tests/unit/signer/test_ledger_signer.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from sys import platform
2+
13
import pytest
24

35
from starknet_py.common import create_sierra_compiled_contract
@@ -18,8 +20,11 @@
1820
from starknet_py.tests.e2e.fixtures.misc import load_contract
1921

2022

21-
# TODO (#1476): Should be re-enabled once Ledger signer is updated with new APDU spec.
22-
@pytest.mark.skip
23+
# TODO (#1425): Currently Ledger tests are skipped on Windows due to different Speculos setup.
24+
@pytest.mark.skipif(
25+
platform == "win32",
26+
reason="Testing Ledger is skipped on Windows due to different Speculos setup.",
27+
)
2328
def test_init_with_invalid_derivation_path():
2429
with pytest.raises(ValueError, match="Empty derivation path"):
2530
LedgerSigner(derivation_path_str="", chain_id=StarknetChainId.SEPOLIA)
@@ -76,8 +81,11 @@ def test_init_with_invalid_derivation_path():
7681
),
7782
],
7883
)
79-
# TODO (#1476): Should be re-enabled once Ledger signer is updated with new APDU spec.
80-
@pytest.mark.skip
84+
# TODO (#1425): Currently Ledger tests are skipped on Windows due to different Speculos setup.
85+
@pytest.mark.skipif(
86+
platform == "win32",
87+
reason="Testing Ledger is skipped on Windows due to different Speculos setup.",
88+
)
8189
def test_sign_transaction(transaction):
8290
# docs: start
8391

@@ -97,8 +105,11 @@ def test_sign_transaction(transaction):
97105
assert all(i != 0 for i in signature)
98106

99107

100-
# TODO (#1476): Should be re-enabled once Ledger signer is updated with new APDU spec.
101-
@pytest.mark.skip
108+
# TODO (#1425): Currently Ledger tests are skipped on Windows due to different Speculos setup.
109+
@pytest.mark.skipif(
110+
platform == "win32",
111+
reason="Testing Ledger is skipped on Windows due to different Speculos setup.",
112+
)
102113
def test_create_account_with_ledger_signer():
103114
# pylint: disable=unused-variable
104115
signer = LedgerSigner(
@@ -132,8 +143,11 @@ async def _get_account_balance_strk(client: FullNodeClient, address: int):
132143

133144

134145
@pytest.mark.asyncio
135-
# TODO (#1476): Should be re-enabled once Ledger signer is updated with new APDU spec.
136-
@pytest.mark.skip
146+
# TODO (#1425): Currently Ledger tests are skipped on Windows due to different Speculos setup.
147+
@pytest.mark.skipif(
148+
platform == "win32",
149+
reason="Testing Ledger is skipped on Windows due to different Speculos setup.",
150+
)
137151
async def test_deploy_account_and_transfer(client):
138152
signer = LedgerSigner(
139153
derivation_path_str="m/2645'/1195502025'/1470455285'/0'/0'/0",

0 commit comments

Comments
 (0)