From d4b4b5e830fbfe93bbf39e8a4a7734f8cff3006a Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Tue, 8 Nov 2022 18:06:32 +0100 Subject: [PATCH 1/2] Disable button clicks while waiting for EIP-712 APDU --- src_bagl/ui_flow_signMessage712.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src_bagl/ui_flow_signMessage712.c b/src_bagl/ui_flow_signMessage712.c index 8e0ee75..9769bb2 100644 --- a/src_bagl/ui_flow_signMessage712.c +++ b/src_bagl/ui_flow_signMessage712.c @@ -16,6 +16,10 @@ static void dummy_cb(void) { ux_flow_prev(); ui_pos = UI_712_POS_REVIEW; } + } else { + // temporarily disable button clicks, they will be re-enabled as soon as new data + // is received and the page is redrawn with ux_flow_init() + G_ux.stack[0].button_push_callback = NULL; } } From 7ea69d17fadcaa02fc9e2de34f788c72062570f4 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 9 Nov 2022 14:47:19 +0100 Subject: [PATCH 2/2] CI Fix --- .github/workflows/ci-workflow.yml | 4 ++-- tests/ragger/ethereum_client/client.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 428de38..e5357df 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -209,7 +209,7 @@ jobs: cd tests/ragger python3 -m venv ./venv . ./venv/bin/activate - pip3 install --extra-index-url https://test.pypi.org/simple/ -r requirements.txt speculos + pip3 install --extra-index-url https://test.pypi.org/simple/ -r requirements.txt # Used for the cache key echo "py_deps=$(pip freeze | md5sum | cut -d' ' -f1)" >> $GITHUB_ENV @@ -275,4 +275,4 @@ jobs: run: | cd tests/ragger . ./venv/bin/activate - pytest --path ./elfs --model ${{ matrix.model }} + pytest --path ./elfs --model ${{ matrix.model }} -s -v diff --git a/tests/ragger/ethereum_client/client.py b/tests/ragger/ethereum_client/client.py index 61b2012..9622a05 100644 --- a/tests/ragger/ethereum_client/client.py +++ b/tests/ragger/ethereum_client/client.py @@ -7,6 +7,7 @@ from ethereum_client.setting import SettingType, SettingImpl from ethereum_client.eip712 import EIP712FieldType from ethereum_client.response_parser import EthereumRespParser import signal +import time class EthereumClient: @@ -92,6 +93,7 @@ class EthereumClient: def eip712_sign_new(self, bip32): with self._send(self._cmd_builder.eip712_sign_new(bip32)): + time.sleep(0.5) # tight on timing, needed by the CI otherwise might fail sometimes if not self._settings[SettingType.VERBOSE_EIP712].value and \ not self._eip712_filtering: # need to skip the message hash self._client.right_click()