Closed Keith-CY closed 1 month ago
I've run the CI of the original repo, and it failed due to the same reason https://github.com/obsidiansystems/ledger-app-nervos/blob/develop/.github/workflows/continuous-integration-workflow.yml
git clone https://github.com/LedgerHQ/speculos.git
docker build -f build.Dockerfile -t speculos-builder:latest .
diff --git a/Dockerfile b/Dockerfile
index 1ab457b..8305c93 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,7 @@
#
# Building the Speculos environment
-FROM ghcr.io/ledgerhq/speculos-builder:latest AS builder
+FROM speculos-builder:latest AS builder
docker build -f Dockerfile -t speculos:latest .
Choose a app file from the workflow https://github.com/LedgerHQ/app-nervos/actions/workflows/continuous-integration-workflow.yml
docker run \
-it \
--rm \
-v \
$(pwd)/apps:/speculos/apps \
--publish 8888:8888 \
--publish 8899:8899 \
--publish 9999:9999 \
speculos apps/app.elf \
--sdk 2.0 \
--display headless \
--button-port 8888 \
--automation-port 8899 \
--apdu-port 9999
while((policy = await screens.next()).header != "Allow contract data") {
speculos.button("Rr");
}
while(policy.body != target) {
speculos.button("RLrl");
policy = await screens.next();
}
do { speculos.button("Rr") } while((await screens.next()).body != "Main menu");
speculos.button("RLrl");
The code here attempts to press buttons to navigate to a specific screen. However, the async function is not always predictable. The test snippet above shows its attempt to press the Rr
button to reach a screen displaying "Allow contract data", but it might skip the target screen if Speculos fails to respond in time, resulting in pressing the button twice
Some necessary sleep is required after pressing a button, or the Ledger may not react in time, which could cause unexpected operations
ckb1qpw9q60tppt7l3j7r09qcp7lxnp3vcanvgha8pmvsa3jplykxn32s4l9ycxc8xncdtp2jzgcrhu6ggl3a7lgv0gzysy32
There are 2 components for connection between Neuron and Ledger Wallet
The App is being maintained at https://github.com/LedgerHQ/app-nervos and it was forked from https://github.com/obsidiansystems/ledger-app-nervos
Recently, the ledger team has tried to enable the CI of building the app(https://github.com/LedgerHQ/app-nervos/blob/develop/.github/workflows/continuous-integration-workflow.yml) but it failed (https://github.com/LedgerHQ/app-nervos/actions/runs/9211189099/job/25340021172) because of timeout.
The tests are written in JavaScript, so they want us to check if we can fix it.