diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f2fb620 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +# Checklist + +- [ ] App update process has been followed +- [ ] Target branch is `develop` +- [ ] Application version has been bumped + + diff --git a/.github/workflows/build_and_functional_tests.yml b/.github/workflows/build_and_functional_tests.yml new file mode 100644 index 0000000..2ad08a1 --- /dev/null +++ b/.github/workflows/build_and_functional_tests.yml @@ -0,0 +1,29 @@ +name: Build and run functional tests using ragger through reusable workflow + +# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation. +# It calls a reusable workflow developed by Ledger's internal developer team to build the application and upload the +# resulting binaries. +# It then calls another reusable workflow to run the Ragger tests on the compiled application binary. + +on: + workflow_dispatch: + push: + branches: + - master + - main + - develop + pull_request: + +jobs: + build_application: + name: Build application using the reusable workflow + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 + with: + upload_app_binaries_artifact: "compiled_app_binaries" + + ragger_tests: + name: Run ragger tests using the reusable workflow + needs: build_application + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 + with: + download_app_binaries_artifact: "compiled_app_binaries" diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index b47ac57..7b53a3d 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -12,54 +12,6 @@ on: - develop jobs: - nanos_build: - name: Build app for NanoS - runs-on: ubuntu-latest - container: - image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest - steps: - - name: Clone - uses: actions/checkout@v2 - - name: Build - run: make - - name: Upload app binary - uses: actions/upload-artifact@v2 - with: - name: celo-app - path: bin - - nanox_build: - name: Build app for NanoX - runs-on: ubuntu-latest - container: - image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest - steps: - - name: Clone - uses: actions/checkout@v2 - - name: Build - run: make BOLOS_SDK=$NANOX_SDK - - name: Upload app binary - uses: actions/upload-artifact@v2 - with: - name: celo-app - path: bin - - job_scan_build: - name: Clang Static Analyzer - runs-on: ubuntu-latest - container: - image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest - steps: - - uses: actions/checkout@v2 - - name: Build with Clang Static Analyzer - run: | - make clean - scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default - - uses: actions/upload-artifact@v2 - if: failure() - with: - name: scan-build - path: scan-build job_unit_test: name: Unit test @@ -71,7 +23,7 @@ jobs: uses: actions/checkout@v2 - name: Build unit tests run: | - cd tests/ + cd tests/unit cmake -Bbuild -H. make -C build make -C build test diff --git a/.github/workflows/guidelines_enforcer.yml b/.github/workflows/guidelines_enforcer.yml new file mode 100644 index 0000000..fdaf9f2 --- /dev/null +++ b/.github/workflows/guidelines_enforcer.yml @@ -0,0 +1,23 @@ +name: Ensure compliance with Ledger guidelines + +# This workflow is mandatory in all applications +# It calls a reusable workflow guidelines_enforcer developed by Ledger's internal developer team. +# The successful completion of the reusable workflow is a mandatory step for an app to be available on the Ledger +# application store. +# +# More information on the guidelines can be found in the repository: +# LedgerHQ/ledger-app-workflows/ + +on: + workflow_dispatch: + push: + branches: + - master + - main + - develop + pull_request: + +jobs: + guidelines_enforcer: + name: Call Ledger guidelines_enforcer + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1 diff --git a/.gitignore b/.gitignore index d9280d1..486d2c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ bin debug -dep -obj src/glyphs.c src/glyphs.h +tests/python/snapshots-tmp/ +__pycache__ +build/ diff --git a/Makefile b/Makefile index f57702c..00a6c10 100755 --- a/Makefile +++ b/Makefile @@ -24,14 +24,14 @@ APP_LOAD_PARAMS= --curve secp256k1 $(COMMON_LOAD_PARAMS) APPVERSION_M=1 APPVERSION_N=1 -APPVERSION_P=8 +APPVERSION_P=10 APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) # Celo APP_LOAD_PARAMS += --path "44'/52752'" APPNAME = "Celo" APP_LOAD_FLAGS=--appFlags 0 -ifeq ($(TARGET_NAME), TARGET_NANOX) +ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) APP_LOAD_FLAGS=--appFlags 0x200 # APPLICATION_FLAG_BOLOS_SETTINGS endif APP_LOAD_PARAMS += $(APP_LOAD_FLAGS) @@ -39,6 +39,8 @@ APP_LOAD_PARAMS += $(APP_LOAD_FLAGS) #prepare hsm generation ifeq ($(TARGET_NAME), TARGET_NANOS) ICONNAME=nanos_app_celo.gif +else ifeq ($(TARGET_NAME),TARGET_STAX) +ICONNAME=stax_app_celo.gif else ICONNAME=nanox_app_celo.gif endif @@ -53,10 +55,9 @@ all: default ############ DEFINES += OS_IO_SEPROXYHAL -DEFINES += HAVE_BAGL HAVE_SPRINTF +DEFINES += HAVE_SPRINTF DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=6 IO_HID_EP_LENGTH=64 HAVE_USB_APDU DEFINES += LEDGER_MAJOR_VERSION=$(APPVERSION_M) LEDGER_MINOR_VERSION=$(APPVERSION_N) LEDGER_PATCH_VERSION=$(APPVERSION_P) -DEFINES += HAVE_UX_FLOW # U2F DEFINES += HAVE_U2F HAVE_IO_U2F @@ -71,7 +72,7 @@ DEFINES += APPVERSION=\"$(APPVERSION)\" DEFINES += HAVE_WEBUSB WEBUSB_URL_SIZE_B=0 WEBUSB_URL="" -ifeq ($(TARGET_NAME),TARGET_NANOX) +ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000 DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE endif @@ -80,12 +81,21 @@ ifeq ($(TARGET_NAME),TARGET_NANOS) DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128 else DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300 -DEFINES += HAVE_GLO096 -DEFINES += HAVE_BAGL BAGL_WIDTH=128 BAGL_HEIGHT=64 -DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_REGULAR_11PX -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX +endif + +ifeq ($(TARGET_NAME),TARGET_STAX) + DEFINES += NBGL_QRCODE + SDK_SOURCE_PATH += qrcode +else + DEFINES += HAVE_BAGL HAVE_UX_FLOW + ifneq ($(TARGET_NAME),TARGET_NANOS) + DEFINES += HAVE_GLO096 + DEFINES += BAGL_WIDTH=128 BAGL_HEIGHT=64 + DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature + DEFINES += HAVE_BAGL_FONT_OPEN_SANS_REGULAR_11PX + DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX + DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX + endif endif # Enabling debug PRINTF @@ -137,11 +147,17 @@ include $(BOLOS_SDK)/Makefile.glyphs ### variables processed by the common makefile.rules of the SDK to grab source files and include dirs APP_SOURCE_PATH += src_common src -SDK_SOURCE_PATH += lib_stusb lib_stusb_impl lib_u2f lib_ux -ifeq ($(TARGET_NAME),TARGET_NANOX) +SDK_SOURCE_PATH += lib_stusb lib_stusb_impl lib_u2f + +ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl endif +ifneq ($(TARGET_NAME),TARGET_STAX) +SDK_SOURCE_PATH += lib_ux +endif + + load: all python -m ledgerblue.loadApp $(APP_LOAD_PARAMS) diff --git a/glyphs/celo_64px.gif b/glyphs/celo_64px.gif new file mode 100644 index 0000000..2cd945c Binary files /dev/null and b/glyphs/celo_64px.gif differ diff --git a/glyphs/icon_toggle_reset.gif b/glyphs/icon_toggle_reset.gif deleted file mode 100644 index 450bc86..0000000 Binary files a/glyphs/icon_toggle_reset.gif and /dev/null differ diff --git a/glyphs/icon_toggle_set.gif b/glyphs/icon_toggle_set.gif deleted file mode 100644 index 571264c..0000000 Binary files a/glyphs/icon_toggle_set.gif and /dev/null differ diff --git a/glyphs/icon_warning.gif b/glyphs/icon_warning.gif deleted file mode 100644 index 1393e05..0000000 Binary files a/glyphs/icon_warning.gif and /dev/null differ diff --git a/ledger_app.toml b/ledger_app.toml new file mode 100644 index 0000000..ab5340f --- /dev/null +++ b/ledger_app.toml @@ -0,0 +1,8 @@ +[app] +build_directory = "./" +sdk = "C" +devices = ["nanos", "nanox", "nanos+", "stax"] + +[tests] +unit_directory = "./tests/unit" +pytest_directory = "./tests/python" diff --git a/src/celo.c b/src/celo.c index b1ddbfe..ea8f1c1 100644 --- a/src/celo.c +++ b/src/celo.c @@ -4,8 +4,7 @@ #include "os.h" #include "utils.h" -// TODO: remove this. This module should be independant from ui -#include "ui_flow.h" +#include "ui_common.h" #include @@ -302,7 +301,7 @@ customStatus_e customProcessor(txContext_t *context) { dataContext.rawDataContext.fieldOffset = 0; if (fieldPos == 0) { array_hexstr(strings.tmp.tmp, dataContext.rawDataContext.data, 4); - ux_flow_init(0, ux_confirm_selector_flow, NULL); + ui_confirm_selector_flow(); } else { uint32_t offset = 0; @@ -314,7 +313,7 @@ customStatus_e customProcessor(txContext_t *context) { strings.tmp.tmp[offset++] = ':'; } } - ux_flow_init(0, ux_confirm_parameter_flow, NULL); + ui_confirm_parameter_flow(); } } else { @@ -520,45 +519,39 @@ void finalizeParsing(bool direct) { switch(provisionType) { case PROVISION_LOCK: case PROVISION_UNLOCK: - ux_flow_init(0, - ux_approval_celo_lock_unlock_flow, - NULL); + ui_approval_celo_lock_unlock_flow(); break; case PROVISION_WITHDRAW: - ux_flow_init(0, - ux_approval_celo_withdraw_flow, - NULL); + ui_approval_celo_withdraw_flow(); break; case PROVISION_VOTE: case PROVISION_REVOKE: - ux_flow_init(0, - ux_approval_celo_vote_revoke_flow, - NULL); + ui_approval_celo_vote_revoke_flow(); break; case PROVISION_ACTIVATE: - ux_flow_init(0, - ux_approval_celo_activate_flow, - NULL); + ui_approval_celo_activate_flow(); break; case PROVISION_RELOCK: - ux_flow_init(0, - ux_approval_celo_relock_flow, - NULL); + ui_approval_celo_relock_flow(); break; case PROVISION_CREATE_ACCOUNT: - ux_flow_init(0, - ux_approval_celo_create_account_flow, - NULL); + ui_approval_celo_create_account_flow(); break; default: if (tmpContent.txContent.gatewayDestinationLength != 0) { - ux_flow_init(0, - ((dataPresent && !N_storage.contractDetails) ? ux_approval_celo_data_warning_gateway_tx_flow : ux_approval_celo_gateway_tx_flow), - NULL); + if (dataPresent && !N_storage.contractDetails) { + ui_approval_celo_data_warning_gateway_tx_flow(); + } + else { + ui_approval_celo_gateway_tx_flow(); + } } else { - ux_flow_init(0, - ((dataPresent && !N_storage.contractDetails) ? ux_approval_celo_data_warning_tx_flow : ux_approval_celo_tx_flow), - NULL); + if (dataPresent && !N_storage.contractDetails) { + ui_approval_celo_data_warning_tx_flow(); + } + else { + ui_approval_celo_tx_flow(); + } } } #endif // NO_CONSENT diff --git a/src/main.c b/src/main.c index 451ae6d..8608d33 100644 --- a/src/main.c +++ b/src/main.c @@ -31,10 +31,13 @@ #include "globals.h" #include "utils.h" - -#include "ui_flow.h" +#include "ui_common.h" uint8_t G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; +bolos_ux_params_t G_ux_params; +ux_state_t G_ux; + + #define APP_FLAG_DATA_ALLOWED 0x01 #define APP_FLAG_EXTERNAL_TOKEN_NEEDED 0x02 @@ -219,7 +222,7 @@ void handleGetPublicKey(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t da else { // prepare for a UI based reply snprintf(strings.common.fullAddress, sizeof(strings.common.fullAddress), "0x%.*s", 40, tmpCtx.publicKeyContext.address); - ux_flow_init(0, ux_display_public_flow, NULL); + ui_display_public_flow(); *flags |= IO_ASYNCH_REPLY; } #endif // NO_CONSENT @@ -429,17 +432,22 @@ void handleSignPersonalMessage(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint cx_hash((cx_hash_t *)&sha3, CX_LAST, workBuffer, 0, tmpCtx.messageSigningContext.hash, 32); cx_hash((cx_hash_t *)&tmpContent.sha2, CX_LAST, workBuffer, 0, hashMessage, 32); +#ifdef HAVE_BAGL #define HASH_LENGTH 4 array_hexstr(strings.common.fullAddress, hashMessage, HASH_LENGTH / 2); strings.common.fullAddress[HASH_LENGTH / 2 * 2] = '.'; strings.common.fullAddress[HASH_LENGTH / 2 * 2 + 1] = '.'; strings.common.fullAddress[HASH_LENGTH / 2 * 2 + 2] = '.'; array_hexstr(strings.common.fullAddress + HASH_LENGTH / 2 * 2 + 3, hashMessage + 32 - HASH_LENGTH / 2, HASH_LENGTH / 2); +#else +#define HASH_LENGTH 32 + array_hexstr(strings.common.fullAddress, hashMessage, HASH_LENGTH); +#endif #ifdef NO_CONSENT io_seproxyhal_touch_signMessage_ok(NULL); #else - ux_flow_init(0, ux_sign_flow, NULL); + ui_display_sign_flow(); #endif // NO_CONSENT *flags |= IO_ASYNCH_REPLY; @@ -609,9 +617,11 @@ void sample_main(void) { } // override point, but nothing more to do +#ifdef HAVE_BAGL void io_seproxyhal_display(const bagl_element_t *element) { io_seproxyhal_display_default((bagl_element_t *)element); } +#endif // HAVE_BAGL unsigned char io_event(unsigned char channel) { UNUSED(channel); @@ -621,12 +631,16 @@ unsigned char io_event(unsigned char channel) { // can't have more than one tag in the reply, not supported yet. switch (G_io_seproxyhal_spi_buffer[0]) { +#ifdef HAVE_NBGL case SEPROXYHAL_TAG_FINGER_EVENT: UX_FINGER_EVENT(G_io_seproxyhal_spi_buffer); break; +#endif // HAVE_NBGL case SEPROXYHAL_TAG_BUTTON_PUSH_EVENT: +#ifdef HAVE_BAGL UX_BUTTON_PUSH_EVENT(G_io_seproxyhal_spi_buffer); +#endif // HAVE_BAGL break; case SEPROXYHAL_TAG_STATUS_EVENT: @@ -637,9 +651,13 @@ unsigned char io_event(unsigned char channel) { default: UX_DEFAULT_EVENT(); break; - case SEPROXYHAL_TAG_DISPLAY_PROCESSED_EVENT: +#ifdef HAVE_BAGL UX_DISPLAYED_EVENT({}); +#endif // HAVE_BAGL +#ifdef HAVE_NBGL + UX_DEFAULT_EVENT(); +#endif // HAVE_NBGL break; case SEPROXYHAL_TAG_TICKER_EVENT: @@ -680,16 +698,18 @@ __attribute__((section(".boot"))) int main(void) { os_boot(); for (;;) { +#ifdef HAVE_BAGL UX_INIT(); +#endif // HAVE_BAGL BEGIN_TRY { TRY { io_seproxyhal_init(); -#ifdef TARGET_NANOX +#ifdef HAVE_BLE // grab the current plane mode setting G_io_app.plane_mode = os_setting_get(OS_SETTING_PLANEMODE, NULL, 0); -#endif // TARGET_NANOX +#endif // HAVE_BLE if (N_storage.initialized != 0x01) { internalStorage_t storage; @@ -707,7 +727,7 @@ __attribute__((section(".boot"))) int main(void) { #ifdef HAVE_BLE // BLE has to be powered on before ui_idle() call for Blue devices only BLE_power(0, NULL); - BLE_power(1, "Nano X"); + BLE_power(1, NULL); #endif // HAVE_BLE ui_idle(); @@ -715,9 +735,11 @@ __attribute__((section(".boot"))) int main(void) { } CATCH(EXCEPTION_IO_RESET) { // reset IO and UX before continuing + CLOSE_TRY; continue; } CATCH_ALL { + CLOSE_TRY; break; } FINALLY { diff --git a/src/ui_bagl.c b/src/ui_bagl.c new file mode 100644 index 0000000..8a0f567 --- /dev/null +++ b/src/ui_bagl.c @@ -0,0 +1,61 @@ +#ifdef HAVE_BAGL +#include "ui_common.h" +#include "ui_flow.h" +#include "globals.h" + +void ui_display_public_flow(void) { + ux_flow_init(0, ux_display_public_flow, NULL); +} + +void ui_display_sign_flow(void) { + ux_flow_init(0, ux_sign_flow, NULL); +} + +void ui_confirm_selector_flow(void) { + ux_flow_init(0, ux_confirm_selector_flow, NULL); +} + +void ui_confirm_parameter_flow(void) { + ux_flow_init(0, ux_confirm_parameter_flow, NULL); +} + +void ui_approval_celo_lock_unlock_flow(void) { + ux_flow_init(0, ux_approval_celo_lock_unlock_flow, NULL); +} + +void ui_approval_celo_withdraw_flow(void) { + ux_flow_init(0, ux_approval_celo_withdraw_flow, NULL); +} + +void ui_approval_celo_vote_revoke_flow(void) { + ux_flow_init(0, ux_approval_celo_vote_revoke_flow, NULL); +} + +void ui_approval_celo_activate_flow(void) { + ux_flow_init(0, ux_approval_celo_activate_flow, NULL); +} + +void ui_approval_celo_relock_flow(void) { + ux_flow_init(0, ux_approval_celo_relock_flow, NULL); +} + +void ui_approval_celo_create_account_flow(void) { + ux_flow_init(0, ux_approval_celo_create_account_flow, NULL); +} + +void ui_approval_celo_data_warning_gateway_tx_flow(void) { + ux_flow_init(0, ux_approval_celo_data_warning_gateway_tx_flow, NULL); +} + +void ui_approval_celo_gateway_tx_flow(void) { + ux_flow_init(0, ux_approval_celo_gateway_tx_flow, NULL); +} + +void ui_approval_celo_data_warning_tx_flow(void) { + ux_flow_init(0, ux_approval_celo_data_warning_tx_flow, NULL); +} + +void ui_approval_celo_tx_flow(void) { + ux_flow_init(0, ux_approval_celo_tx_flow, NULL); +} +#endif // HAVE_BAGL diff --git a/src/ui_common.c b/src/ui_common.c index 5e5c5c0..349a9da 100644 --- a/src/ui_common.c +++ b/src/ui_common.c @@ -5,8 +5,13 @@ #include "globals.h" #include "utils.h" -unsigned int io_seproxyhal_touch_data_ok(const bagl_element_t *e) { - UNUSED(e); +#ifdef HAVE_NBGL +nbgl_layoutTagValue_t tagValuePair[5]; +nbgl_layoutTagValueList_t tagValueList; +nbgl_pageInfoLongPress_t infoLongPress; +#endif // HAVE_NBGL + +unsigned int io_seproxyhal_touch_data_ok(void) { parserStatus_e txResult = USTREAM_FINISHED; txResult = continueTx(&txContext); switch (txResult) { @@ -16,18 +21,24 @@ unsigned int io_seproxyhal_touch_data_ok(const bagl_element_t *e) { break; case USTREAM_PROCESSING: io_seproxyhal_send_status(0x9000); +#ifdef HAVE_BAGL ui_idle(); +#endif // HAVE_BAGL break; case USTREAM_FAULT: reset_app_context(); io_seproxyhal_send_status(0x6A80); +#ifdef HAVE_BAGL ui_idle(); +#endif // HAVE_BAGL break; default: PRINTF("Unexpected parser status\n"); reset_app_context(); io_seproxyhal_send_status(0x6A80); +#ifdef HAVE_BAGL ui_idle(); +#endif // HAVE_BAGL } if (txResult == USTREAM_FINISHED) { @@ -37,42 +48,44 @@ unsigned int io_seproxyhal_touch_data_ok(const bagl_element_t *e) { return 0; } -unsigned int io_seproxyhal_touch_data_cancel(const bagl_element_t *e) { - UNUSED(e); +unsigned int io_seproxyhal_touch_data_cancel(void) { reset_app_context(); io_seproxyhal_send_status(0x6985); +#ifdef HAVE_BAGL // Display back the original UX ui_idle(); +#endif // HAVE_BAGL return 0; // do not redraw the widget } -unsigned int io_seproxyhal_touch_address_ok(const bagl_element_t *e) { - UNUSED(e); +unsigned int io_seproxyhal_touch_address_ok(void) { uint32_t tx = set_result_get_publicKey(); G_io_apdu_buffer[tx++] = 0x90; G_io_apdu_buffer[tx++] = 0x00; reset_app_context(); // Send back the response, do not restart the event loop io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, tx); +#ifdef HAVE_BAGL // Display back the original UX ui_idle(); +#endif // HAVE_BAGL return 0; // do not redraw the widget } -unsigned int io_seproxyhal_touch_address_cancel(const bagl_element_t *e) { - UNUSED(e); +unsigned int io_seproxyhal_touch_address_cancel(void) { G_io_apdu_buffer[0] = 0x69; G_io_apdu_buffer[1] = 0x85; reset_app_context(); // Send back the response, do not restart the event loop io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, 2); +#ifdef HAVE_BAGL // Display back the original UX ui_idle(); +#endif // HAVE_BAGL return 0; // do not redraw the widget } -unsigned int io_seproxyhal_touch_tx_ok(const bagl_element_t *e) { - UNUSED(e); +unsigned int io_seproxyhal_touch_tx_ok(void) { uint8_t privateKeyData[32]; uint8_t signature[100]; cx_ecfp_private_key_t privateKey; @@ -114,25 +127,27 @@ unsigned int io_seproxyhal_touch_tx_ok(const bagl_element_t *e) { reset_app_context(); // Send back the response, do not restart the event loop io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, tx); +#ifdef HAVE_BAGL // Display back the original UX ui_idle(); +#endif // HAVE_BAGL return 0; // do not redraw the widget } -unsigned int io_seproxyhal_touch_tx_cancel(const bagl_element_t *e) { - UNUSED(e); +unsigned int io_seproxyhal_touch_tx_cancel(void) { reset_app_context(); G_io_apdu_buffer[0] = 0x69; G_io_apdu_buffer[1] = 0x85; // Send back the response, do not restart the event loop io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, 2); +#ifdef HAVE_BAGL // Display back the original UX ui_idle(); +#endif // HAVE_BAGL return 0; // do not redraw the widget } -unsigned int io_seproxyhal_touch_signMessage_ok(const bagl_element_t *e) { - UNUSED(e); +unsigned int io_seproxyhal_touch_signMessage_ok(void) { uint8_t privateKeyData[32]; uint8_t signature[100]; cx_ecfp_private_key_t privateKey; @@ -164,19 +179,22 @@ unsigned int io_seproxyhal_touch_signMessage_ok(const bagl_element_t *e) { reset_app_context(); // Send back the response, do not restart the event loop io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, tx); +#ifdef HAVE_BAGL // Display back the original UX ui_idle(); +#endif // HAVE_BAGL return 0; // do not redraw the widget } -unsigned int io_seproxyhal_touch_signMessage_cancel(const bagl_element_t *e) { - UNUSED(e); +unsigned int io_seproxyhal_touch_signMessage_cancel(void) { reset_app_context(); G_io_apdu_buffer[0] = 0x69; G_io_apdu_buffer[1] = 0x85; // Send back the response, do not restart the event loop io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, 2); +#ifdef HAVE_BAGL // Display back the original UX ui_idle(); +#endif // HAVE_BAGL return 0; // do not redraw the widget } diff --git a/src/ui_common.h b/src/ui_common.h index a3b7564..200d707 100644 --- a/src/ui_common.h +++ b/src/ui_common.h @@ -4,16 +4,38 @@ #include "ux.h" +#ifdef HAVE_NBGL +#include "nbgl_use_case.h" + +extern nbgl_layoutTagValue_t tagValuePair[5]; +extern nbgl_layoutTagValueList_t tagValueList; +extern nbgl_pageInfoLongPress_t infoLongPress; +#endif // HAVE_NBGL + void ui_idle(void); // must be implemented by each ui handler +void ui_display_public_flow(void); +void ui_display_sign_flow(void); +void ui_confirm_selector_flow(void); +void ui_confirm_parameter_flow(void); +void ui_approval_celo_lock_unlock_flow(void); +void ui_approval_celo_withdraw_flow(void); +void ui_approval_celo_vote_revoke_flow(void); +void ui_approval_celo_activate_flow(void); +void ui_approval_celo_relock_flow(void); +void ui_approval_celo_create_account_flow(void); +void ui_approval_celo_data_warning_gateway_tx_flow(void); +void ui_approval_celo_gateway_tx_flow(void); +void ui_approval_celo_data_warning_tx_flow(void); +void ui_approval_celo_tx_flow(void); -unsigned int io_seproxyhal_touch_data_ok(const bagl_element_t *e); -unsigned int io_seproxyhal_touch_data_cancel(const bagl_element_t *e); +unsigned int io_seproxyhal_touch_data_ok(void); +unsigned int io_seproxyhal_touch_data_cancel(void); -unsigned int io_seproxyhal_touch_address_ok(const bagl_element_t *e); -unsigned int io_seproxyhal_touch_address_cancel(const bagl_element_t *e); +unsigned int io_seproxyhal_touch_address_ok(void); +unsigned int io_seproxyhal_touch_address_cancel(void); -unsigned int io_seproxyhal_touch_tx_ok(const bagl_element_t *e); -unsigned int io_seproxyhal_touch_tx_cancel(const bagl_element_t *e); +unsigned int io_seproxyhal_touch_tx_ok(void); +unsigned int io_seproxyhal_touch_tx_cancel(void); -unsigned int io_seproxyhal_touch_signMessage_ok(const bagl_element_t *e); -unsigned int io_seproxyhal_touch_signMessage_cancel(const bagl_element_t *e); +unsigned int io_seproxyhal_touch_signMessage_ok(void); +unsigned int io_seproxyhal_touch_signMessage_cancel(void); diff --git a/src/ui_confirm_selector_nbgl.c b/src/ui_confirm_selector_nbgl.c new file mode 100644 index 0000000..9b6279c --- /dev/null +++ b/src/ui_confirm_selector_nbgl.c @@ -0,0 +1,57 @@ +#ifdef HAVE_NBGL +#include "globals.h" +#include "ui_common.h" +#include "nbgl_use_case.h" +#include "bolos_target.h" + +static void rejectCallback(void) { + io_seproxyhal_touch_data_cancel(); +} + +static void approveCallback(void) { + io_seproxyhal_touch_data_ok(); +} + +static void confirmationCallback(bool confirm) { + if (confirm) { + nbgl_useCaseStatus("SELECTOR\nAPPROVED", true, ui_idle); + approveCallback(); + } + else { + nbgl_useCaseStatus("Selector rejected", false, ui_idle); + rejectCallback(); + } +} + +static void continueCallback(void) { + tagValueList.pairs = tagValuePair; + tagValueList.smallCaseForValue = false; + + infoLongPress.text = "Approve selector"; + infoLongPress.icon = &C_celo_64px; + infoLongPress.longPressText = "Hold to sign"; + infoLongPress.longPressToken = 0; + infoLongPress.tuneId = TUNE_TAP_CASUAL; + + nbgl_useCaseStaticReview(&tagValueList, &infoLongPress, "Cancel", confirmationCallback); +} + +void ui_confirm_selector_flow(void) { + tagValuePair[0].item = "Selector"; + tagValuePair[0].value = (char*)strings.tmp.tmp; + + tagValueList.nbPairs = 1; + + nbgl_useCaseReviewStart(&C_celo_64px, "Verify selector", "", "Cancel", continueCallback, rejectCallback); +} + +void ui_confirm_parameter_flow(void) { + tagValuePair[0].item = "Parameter"; + tagValuePair[0].value = (char*)strings.tmp.tmp; + + tagValueList.nbPairs = 1; + + nbgl_useCaseReviewStart(&C_celo_64px, "Verify", strings.tmp.tmp2, "Cancel", continueCallback, rejectCallback); +} + +#endif // HAVE_NBGL diff --git a/src/ui_display_public_nbgl.c b/src/ui_display_public_nbgl.c new file mode 100644 index 0000000..814535c --- /dev/null +++ b/src/ui_display_public_nbgl.c @@ -0,0 +1,34 @@ +#ifdef HAVE_NBGL +#include "globals.h" +#include "ui_common.h" +#include "bolos_target.h" + +static void address_cancel(void) { + nbgl_useCaseStatus("Address rejected", false, ui_idle); + io_seproxyhal_touch_address_cancel(); +} + +static void address_confirmation(bool confirm) { + if (confirm) { + nbgl_useCaseStatus("ADDRESS\nAPPROVED", true, ui_idle); + io_seproxyhal_touch_address_ok(); + } + else { + address_cancel(); + } +} + +static void address_display(void) { + nbgl_useCaseAddressConfirmation(strings.common.fullAddress, address_confirmation); +} + +void ui_display_public_flow(void) { + nbgl_useCaseReviewStart(&C_celo_64px, + "Verify Celo\naddress", + "", + "Cancel", + address_display, + address_cancel); +} + +#endif // HAVE_NBGL diff --git a/src/ui_flow.c b/src/ui_flow.c index 84a3662..c0c3743 100644 --- a/src/ui_flow.c +++ b/src/ui_flow.c @@ -1,11 +1,9 @@ +#ifdef HAVE_BAGL #include "bolos_target.h" #include "ui_flow.h" #include "globals.h" -ux_state_t G_ux; -bolos_ux_params_t G_ux_params; - void ui_idle(void) { // reserve a display stack slot if none yet if(G_ux.stack_count == 0) { @@ -175,7 +173,7 @@ UX_STEP_NOCB( UX_STEP_CB( ux_display_public_flow_3_step, pb, - io_seproxyhal_touch_address_ok(NULL), + io_seproxyhal_touch_address_ok(), { &C_icon_validate_14, "Approve", @@ -183,7 +181,7 @@ UX_STEP_CB( UX_STEP_CB( ux_display_public_flow_4_step, pb, - io_seproxyhal_touch_address_cancel(NULL), + io_seproxyhal_touch_address_cancel(), { &C_icon_crossmark, "Reject", @@ -216,7 +214,7 @@ UX_STEP_NOCB( UX_STEP_CB( ux_confirm_selector_flow_3_step, pb, - io_seproxyhal_touch_data_ok(NULL), + io_seproxyhal_touch_data_ok(), { &C_icon_validate_14, "Approve", @@ -224,7 +222,7 @@ UX_STEP_CB( UX_STEP_CB( ux_confirm_selector_flow_4_step, pb, - io_seproxyhal_touch_data_cancel(NULL), + io_seproxyhal_touch_data_cancel(), { &C_icon_crossmark, "Reject", @@ -258,7 +256,7 @@ UX_STEP_NOCB( UX_STEP_CB( ux_confirm_parameter_flow_3_step, pb, - io_seproxyhal_touch_data_ok(NULL), + io_seproxyhal_touch_data_ok(), { &C_icon_validate_14, "Approve", @@ -267,7 +265,7 @@ UX_STEP_CB( UX_STEP_CB( ux_confirm_parameter_flow_4_step, pb, - io_seproxyhal_touch_data_cancel(NULL), + io_seproxyhal_touch_data_cancel(), { &C_icon_crossmark, "Reject", @@ -348,7 +346,7 @@ UX_STEP_NOCB( UX_STEP_CB( ux_approval_tx_5_step, pbb, - io_seproxyhal_touch_tx_ok(NULL), + io_seproxyhal_touch_tx_ok(), { &C_icon_validate_14, "Accept", @@ -357,7 +355,7 @@ UX_STEP_CB( UX_STEP_CB( ux_approval_tx_6_step, pb, - io_seproxyhal_touch_tx_cancel(NULL), + io_seproxyhal_touch_tx_cancel(), { &C_icon_crossmark, "Reject", @@ -487,7 +485,7 @@ UX_STEP_NOCB( UX_STEP_CB( ux_sign_flow_3_step, pbb, - io_seproxyhal_touch_signMessage_ok(NULL), + io_seproxyhal_touch_signMessage_ok(), { &C_icon_validate_14, "Sign", @@ -497,7 +495,7 @@ UX_STEP_CB( UX_STEP_CB( ux_sign_flow_4_step, pbb, - io_seproxyhal_touch_signMessage_cancel(NULL), + io_seproxyhal_touch_signMessage_cancel(), { &C_icon_crossmark, "Cancel", @@ -510,3 +508,4 @@ UX_FLOW(ux_sign_flow, &ux_sign_flow_3_step, &ux_sign_flow_4_step ); +#endif // HAVE_BAGL diff --git a/src/ui_settings_nbgl.c b/src/ui_settings_nbgl.c new file mode 100644 index 0000000..ea9aa3c --- /dev/null +++ b/src/ui_settings_nbgl.c @@ -0,0 +1,106 @@ +#ifdef HAVE_NBGL +#include "globals.h" +#include "ui_common.h" +#include "nbgl_use_case.h" +#include "bolos_target.h" + +#define NB_INFO_FIELDS 2 +#define PAGE_START 0 +#define NB_PAGE_SETTING 2 +#define IS_TOUCHABLE false + +// Forward declaration +static void displaySettingsMenu(void); +static void settingsControlsCallback(int token, uint8_t index); +static bool settingsNavCallback(uint8_t page, nbgl_pageContent_t *content); + +enum { + SWITCH_CONTRACT_DATA_SET_TOKEN = FIRST_USER_TOKEN, + SWITCH_DEBUG_DATA_SET_TOKEN, + NB_SETTINGS_SWITCHES, +}; + +static nbgl_layoutSwitch_t switches[NB_SETTINGS_SWITCHES - FIRST_USER_TOKEN]; + +static const char* const infoTypes[] = {"Version", "Celo App"}; +static const char* const infoContents[] = {APPVERSION, "(c) 2022 Ledger"}; + +static void onQuitCallback(void) { + os_sched_exit(-1); +} + +static bool settingsNavCallback(uint8_t page, nbgl_pageContent_t *content) { + if (page == 0) { + content->type = INFOS_LIST; + content->infosList.nbInfos = NB_INFO_FIELDS; + content->infosList.infoTypes = (const char**) infoTypes; + content->infosList.infoContents = (const char**) infoContents; + } + else if (page == 1) { + switches[0].text = "Contract data"; + switches[0].subText = "Allow contract data\nin transactions"; + switches[0].token = SWITCH_CONTRACT_DATA_SET_TOKEN; + switches[0].tuneId = TUNE_TAP_CASUAL; + switches[0].initState = N_storage.dataAllowed; + + switches[1].text = "Debug data"; + switches[1].subText = "Display contract data details"; + switches[1].token = SWITCH_DEBUG_DATA_SET_TOKEN; + switches[1].tuneId = TUNE_TAP_CASUAL; + switches[1].initState = N_storage.contractDetails; + + content->type = SWITCHES_LIST; + content->switchesList.nbSwitches = NB_SETTINGS_SWITCHES - FIRST_USER_TOKEN, + content->switchesList.switches = (nbgl_layoutSwitch_t*) switches; + } + else { + return false; + } + return true; +} + +static void switch_settings_contract_data() { + uint8_t value = (N_storage.dataAllowed ? 0 : 1); + nvm_write(&N_storage.dataAllowed, (void*)&value, sizeof(uint8_t)); +} + +static void switch_settings_display_data() { + uint8_t value = (N_storage.contractDetails ? 0 : 1); + nvm_write(&N_storage.contractDetails, (void*)&value, sizeof(uint8_t)); +} + +static void settingsControlsCallback(int token, uint8_t index) { + UNUSED(index); + switch(token) + { + case SWITCH_CONTRACT_DATA_SET_TOKEN: + switch_settings_contract_data(); + break; + + case SWITCH_DEBUG_DATA_SET_TOKEN: + switch_settings_display_data(); + break; + + default: + PRINTF("Should not happen !"); + break; + } + + switches[0].initState = N_storage.dataAllowed; + switches[1].initState = N_storage.contractDetails; + + displaySettingsMenu(); +} + +static void displaySettingsMenu(void) { + nbgl_useCaseSettings("Celo settings", PAGE_START, NB_PAGE_SETTING, IS_TOUCHABLE, ui_idle, + settingsNavCallback, settingsControlsCallback); +} + +void ui_idle(void) { + nbgl_useCaseHome("Celo", &C_celo_64px, + NULL, true, + displaySettingsMenu, onQuitCallback); +} + +#endif // HAVE_NBGL diff --git a/src/ui_sign_nbgl.c b/src/ui_sign_nbgl.c new file mode 100644 index 0000000..7d16d78 --- /dev/null +++ b/src/ui_sign_nbgl.c @@ -0,0 +1,47 @@ +#ifdef HAVE_NBGL +#include "globals.h" +#include "ui_common.h" +#include "nbgl_use_case.h" +#include "bolos_target.h" + +static void sign_cancel(void) { + nbgl_useCaseStatus("Message rejected", false, ui_idle); + io_seproxyhal_touch_signMessage_cancel(); +} + +static void sign_confirmation(bool confirm) { + if (confirm) { + nbgl_useCaseStatus("MESSAGE\nAPPROVED", true, ui_idle); + io_seproxyhal_touch_signMessage_ok(); + } + else { + sign_cancel(); + } +} + +static void sign_display(void) { + tagValuePair[0].item = "Message hash"; + tagValuePair[0].value = (char*)strings.common.fullAddress; + + tagValueList.nbPairs = 1; + tagValueList.pairs = tagValuePair; + tagValueList.smallCaseForValue = false; + + infoLongPress.text = "Sign message"; + infoLongPress.icon = &C_celo_64px; + infoLongPress.longPressText = "Hold to sign"; + infoLongPress.longPressToken = 0; + infoLongPress.tuneId = TUNE_TAP_CASUAL; + + nbgl_useCaseStaticReview(&tagValueList, &infoLongPress, "Cancel", sign_confirmation); +} + +void ui_display_sign_flow(void) { + nbgl_useCaseReviewStart(&C_celo_64px, + "Review message", + "", + "Cancel", + sign_display, + sign_cancel); +} +#endif // HAVE_NBGL diff --git a/src/ui_tx_nbgl.c b/src/ui_tx_nbgl.c new file mode 100644 index 0000000..c26222a --- /dev/null +++ b/src/ui_tx_nbgl.c @@ -0,0 +1,176 @@ +#ifdef HAVE_NBGL +#include "globals.h" +#include "ui_common.h" +#include "nbgl_use_case.h" +#include "bolos_target.h" + +static void rejectCallback(void) { + io_seproxyhal_touch_tx_cancel(); +} + +static void approveCallback(void) { + io_seproxyhal_touch_tx_ok(); +} + +static void confirmationCallback(bool confirm) { + if (confirm) { + nbgl_useCaseStatus("TRANSACTION\nAPPROVED", true, ui_idle); + approveCallback(); + } + else { + nbgl_useCaseStatus("Transaction rejected", false, ui_idle); + rejectCallback(); + } +} + +static void continueCallback(void) { + tagValueList.pairs = tagValuePair; + + infoLongPress.text = "Approve Transaction"; + infoLongPress.icon = &C_celo_64px; + infoLongPress.longPressText = "Hold to sign"; + infoLongPress.longPressToken = 0; + infoLongPress.tuneId = TUNE_TAP_CASUAL; + + nbgl_useCaseStaticReview(&tagValueList, &infoLongPress, "Cancel", confirmationCallback); +} + +static void warningCallback(void) { + nbgl_useCaseReviewStart(&C_warning64px, "WARNING", "Data present", "Cancel", continueCallback, rejectCallback); +} + +static void fill_data_tx(void) { + tagValuePair[0].item = "Amount"; + tagValuePair[0].value = (char*)strings.common.fullAmount; + + tagValuePair[1].item = "Address"; + tagValuePair[1].value = (char*)strings.common.fullAddress; + + tagValuePair[2].item = "Max Fees"; + tagValuePair[2].value = (char*)strings.common.maxFee; + + tagValueList.nbPairs = 3; +} + +static void fill_gateway_tx(void) { + tagValuePair[0].item = "Amount"; + tagValuePair[0].value = (char*)strings.common.fullAmount; + + tagValuePair[1].item = "Address"; + tagValuePair[1].value = (char*)strings.common.fullAddress; + + tagValuePair[2].item = "Max Fees"; + tagValuePair[2].value = (char*)strings.common.maxFee; + + tagValuePair[3].item = "Gateway Fee"; + tagValuePair[3].value = (char*)strings.common.gatewayFee; + + tagValuePair[4].item = "Gateway Address"; + tagValuePair[4].value = (char*)strings.common.fullGatewayAddress; + + tagValueList.nbPairs = 5; +} + +static void fill_lock_relock(void) { + tagValuePair[0].item = "Type"; + tagValuePair[0].value = (char*)strings.common.stakingType; + + tagValuePair[1].item = "Amount"; + tagValuePair[1].value = (char*)strings.common.fullAmount; + + tagValuePair[2].item = "Max Fees"; + tagValuePair[2].value = (char*)strings.common.maxFee; + + tagValueList.nbPairs = 3; +} + +static void fill_withdraw_or_create_account(void) { + tagValuePair[0].item = "Type"; + tagValuePair[0].value = (char*)strings.common.stakingType; + + tagValuePair[1].item = "Max Fees"; + tagValuePair[1].value = (char*)strings.common.maxFee; + + tagValueList.nbPairs = 2; +} + +static void fill_activate(void) { + tagValuePair[0].item = "Type"; + tagValuePair[0].value = (char*)strings.common.stakingType; + + tagValuePair[1].item = "Validator"; + tagValuePair[1].value = (char*)strings.common.fullAddress; + + tagValuePair[2].item = "Max Fees"; + tagValuePair[2].value = (char*)strings.common.maxFee; + + tagValueList.nbPairs = 3; +} + +static void fill_vote_revoke(void) { + tagValuePair[0].item = "Type"; + tagValuePair[0].value = (char*)strings.common.stakingType; + + tagValuePair[1].item = "Amount"; + tagValuePair[1].value = (char*)strings.common.fullAmount; + + tagValuePair[2].item = "Validator"; + tagValuePair[2].value = (char*)strings.common.fullAddress; + + tagValuePair[3].item = "Max Fees"; + tagValuePair[3].value = (char*)strings.common.maxFee; + + tagValueList.nbPairs = 4; +} + +void ui_approval_celo_tx_flow(void) { + fill_data_tx(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", continueCallback, rejectCallback); +} + +void ui_approval_celo_data_warning_tx_flow(void) { + fill_data_tx(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", warningCallback, rejectCallback); +} + +void ui_approval_celo_gateway_tx_flow(void) { + fill_gateway_tx(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", continueCallback, rejectCallback); +} + +void ui_approval_celo_data_warning_gateway_tx_flow(void) { + fill_gateway_tx(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", warningCallback, rejectCallback); +} + +void ui_approval_celo_lock_unlock_flow(void) { + fill_lock_relock(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", continueCallback, rejectCallback); +} + +void ui_approval_celo_relock_flow(void) { + fill_lock_relock(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", continueCallback, rejectCallback); +} + +void ui_approval_celo_withdraw_flow(void) { + fill_withdraw_or_create_account(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", continueCallback, rejectCallback); +} + +void ui_approval_celo_create_account_flow(void) { + fill_withdraw_or_create_account(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", continueCallback, rejectCallback); +} + +void ui_approval_celo_activate_flow(void) { + fill_activate(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", continueCallback, rejectCallback); +} + +void ui_approval_celo_vote_revoke_flow(void) { + fill_vote_revoke(); + nbgl_useCaseReviewStart(&C_celo_64px, "Review transaction", "", "Cancel", continueCallback, rejectCallback); +} + +#endif // HAVE_NBGL diff --git a/stax_app_celo.gif b/stax_app_celo.gif new file mode 100644 index 0000000..ee155bb Binary files /dev/null and b/stax_app_celo.gif differ diff --git a/tests/python/__init__.py b/tests/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/python/apps/__init__.py b/tests/python/apps/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/python/apps/celo.py b/tests/python/apps/celo.py new file mode 100644 index 0000000..04d3602 --- /dev/null +++ b/tests/python/apps/celo.py @@ -0,0 +1,93 @@ +from typing import List, Generator +from enum import IntEnum +from contextlib import contextmanager + +from ragger.backend.interface import BackendInterface, RAPDU + +from .celo_cmd_builder import * +import rlp + + +class INS(IntEnum): + INS_GET_PUBLIC_KEY = 0x02 + INS_SIGN = 0x04 + INS_GET_APP_CONFIGURATION = 0x06 + INS_SIGN_PERSONAL_MESSAGE = 0x08 + INS_PROVIDE_ERC20_TOKEN_INFORMATION = 0x0A + INS_GET_APP_TYPE = 0x0C + +CLA = 0xE0 + +MAX_CHUNK_SIZE = 255 + + +class StatusCode(IntEnum): + STATUS_OK = 0x9000 + + +class Param(IntEnum): + P1_DirectlyFetchAddress = 0x00 # Return address directly from the wallet + P1_ShowFetchAddress = 0x01 # Return address from the wallet after showing it + P1_InitTransactionData = 0x00 # First transaction data block for signing + P1_ContTransactionData = 0x80 # Subsequent transaction data block for signing + P2_DiscardAddressChainCode = 0x00 # Do not return the chain code along with the address + P1_UNUSED = 0x00 # Default value + P2_UNUSED = 0x00 # Default value + + +class CeloClient: + backend: BackendInterface + + def __init__(self, backend): + self._client = backend + + + def get_version(self) -> bytes: + version: RAPDU = self._client.exchange(CLA, INS.INS_GET_APP_CONFIGURATION, + Param.P1_UNUSED, Param.P2_UNUSED) + return version + + + @contextmanager + def send_in_chunk_async(self, instruction: int, payload: bytes) -> Generator[None, None, None]: + p1 = Param.P1_InitTransactionData + while (len(payload) > 0): + chunk = MAX_CHUNK_SIZE + if chunk > len(payload): + chunk = len(payload) + + with self._client.exchange_async(CLA, instruction, p1, Param.P2_UNUSED, payload[:chunk]): + yield + + payload = payload[chunk:] + p1 = Param.P1_ContTransactionData + + + @contextmanager + def derive_address_async(self, derivation_path: bytes, show: bool, chaincode: bool) -> Generator[None, None, None]: + p1 = Param.P1_ShowFetchAddress if show else Param.P1_DirectlyFetchAddress + p2 = Param.P2_UNUSED if chaincode else Param.P2_DiscardAddressChainCode + + with self._client.exchange_async(CLA, INS.INS_GET_PUBLIC_KEY, p1, p2, derivation_path): + yield + + + @contextmanager + def sign_data_async(self, derivation_path: bytes, data: str) -> Generator[None, None, None]: + payload: bytes = derivation_path + payload += len(data).to_bytes(4, byteorder='big') + payload += str.encode(data) + + with self.send_in_chunk_async(INS.INS_SIGN_PERSONAL_MESSAGE, payload): + yield + + + @contextmanager + def sign_transaction_async(self, derivation_path : bytes, arg_list : List[str]) -> Generator[None, None, None]: + encoded = rlp.encode(arg_list) + + payload: bytes = derivation_path + payload += encoded + + with self.send_in_chunk_async(INS.INS_SIGN, payload): + yield diff --git a/tests/python/apps/celo_cmd_builder.py b/tests/python/apps/celo_cmd_builder.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/python/apps/celo_utils.py b/tests/python/apps/celo_utils.py new file mode 100644 index 0000000..b6d66c2 --- /dev/null +++ b/tests/python/apps/celo_utils.py @@ -0,0 +1,3 @@ +from ragger.bip import pack_derivation_path + +CELO_PACKED_DERIVATION_PATH = pack_derivation_path("m/44'/52752'/12345'") diff --git a/tests/python/conftest.py b/tests/python/conftest.py new file mode 100644 index 0000000..909ec8b --- /dev/null +++ b/tests/python/conftest.py @@ -0,0 +1,15 @@ +from ragger.conftest import configuration + +########################### +### CONFIGURATION START ### +########################### + +# You can configure optional parameters by overriding the value of ragger.configuration.OPTIONAL_CONFIGURATION +# Please refer to ragger/conftest/configuration.py for their descriptions and accepted values + +######################### +### CONFIGURATION END ### +######################### + +# Pull all features from the base ragger conftest using the overridden configuration +pytest_plugins = ("ragger.conftest.base_conftest", ) diff --git a/tests/python/requirements.txt b/tests/python/requirements.txt new file mode 100644 index 0000000..7fb8c18 --- /dev/null +++ b/tests/python/requirements.txt @@ -0,0 +1,4 @@ +base58 +bip32 +ragger[tests,speculos] +rlp diff --git a/tests/python/snapshots/nanos/test_celo_derive_address/00000.png b/tests/python/snapshots/nanos/test_celo_derive_address/00000.png new file mode 100644 index 0000000..63778c4 Binary files /dev/null and b/tests/python/snapshots/nanos/test_celo_derive_address/00000.png differ diff --git a/tests/python/snapshots/nanos/test_celo_derive_address/00001.png b/tests/python/snapshots/nanos/test_celo_derive_address/00001.png new file mode 100644 index 0000000..58f6569 Binary files /dev/null and b/tests/python/snapshots/nanos/test_celo_derive_address/00001.png differ diff --git a/tests/python/snapshots/nanos/test_celo_derive_address/00002.png b/tests/python/snapshots/nanos/test_celo_derive_address/00002.png new file mode 100644 index 0000000..ccdb51d Binary files /dev/null and b/tests/python/snapshots/nanos/test_celo_derive_address/00002.png differ diff --git a/tests/python/snapshots/nanos/test_celo_derive_address/00003.png b/tests/python/snapshots/nanos/test_celo_derive_address/00003.png new file mode 100644 index 0000000..7265edf Binary files /dev/null and b/tests/python/snapshots/nanos/test_celo_derive_address/00003.png differ diff --git a/tests/python/snapshots/nanos/test_celo_derive_address/00004.png b/tests/python/snapshots/nanos/test_celo_derive_address/00004.png new file mode 100644 index 0000000..66c411c Binary files /dev/null and b/tests/python/snapshots/nanos/test_celo_derive_address/00004.png differ diff --git a/tests/python/snapshots/nanos/test_celo_derive_address/00005.png b/tests/python/snapshots/nanos/test_celo_derive_address/00005.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_celo_derive_address/00005.png differ diff --git a/tests/python/snapshots/nanos/test_celo_derive_address/00006.png b/tests/python/snapshots/nanos/test_celo_derive_address/00006.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_celo_derive_address/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_data/00000.png b/tests/python/snapshots/nanos/test_sign_data/00000.png new file mode 100644 index 0000000..ab16f62 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_data/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_data/00001.png b/tests/python/snapshots/nanos/test_sign_data/00001.png new file mode 100644 index 0000000..b5d2030 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_data/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_data/00002.png b/tests/python/snapshots/nanos/test_sign_data/00002.png new file mode 100644 index 0000000..f5c2d67 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_data/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_data/00003.png b/tests/python/snapshots/nanos/test_sign_data/00003.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_data/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00001.png new file mode 100644 index 0000000..cb76b61 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00002.png new file mode 100644 index 0000000..a7c4e6c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00003.png new file mode 100644 index 0000000..bc741dd Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00004.png new file mode 100644 index 0000000..7aac2e5 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00005.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00006.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00007.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00008.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_activate/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_activate/00009.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_activate/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_create/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_create/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_create/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_create/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_create/00001.png new file mode 100644 index 0000000..09844cb Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_create/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_create/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_create/00002.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_create/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_create/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_create/00003.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_create/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_create/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_create/00004.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_create/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_create/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_create/00005.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_create/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_create/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_create/00006.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_create/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00001.png new file mode 100644 index 0000000..2b72a28 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00002.png new file mode 100644 index 0000000..85d5804 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00003.png new file mode 100644 index 0000000..800391f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00004.png new file mode 100644 index 0000000..3ec4b9f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00005.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00006.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00007.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00008.png new file mode 100644 index 0000000..9311e03 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00009.png new file mode 100644 index 0000000..4112824 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00010.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00010.png new file mode 100644 index 0000000..edecb87 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00010.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00011.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00011.png new file mode 100644 index 0000000..0e19496 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00011.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00012.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00012.png new file mode 100644 index 0000000..e3a54ff Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00012.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00013.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00013.png new file mode 100644 index 0000000..ddd5155 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00013.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00014.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00014.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00014.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_empty/00015.png b/tests/python/snapshots/nanos/test_sign_transaction_empty/00015.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_empty/00015.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_lock/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_lock/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_lock/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_lock/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_lock/00001.png new file mode 100644 index 0000000..391eba2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_lock/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_lock/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_lock/00002.png new file mode 100644 index 0000000..2b72a28 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_lock/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_lock/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_lock/00003.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_lock/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_lock/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_lock/00004.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_lock/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_lock/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_lock/00005.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_lock/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_lock/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_lock/00006.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_lock/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_lock/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_lock/00007.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_lock/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00001.png new file mode 100644 index 0000000..2b72a28 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00002.png new file mode 100644 index 0000000..85d5804 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00003.png new file mode 100644 index 0000000..800391f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00004.png new file mode 100644 index 0000000..3ec4b9f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00005.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00006.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00007.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00008.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00009.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00001.png new file mode 100644 index 0000000..5adfa7b Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00002.png new file mode 100644 index 0000000..2b72a28 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00003.png new file mode 100644 index 0000000..85d5804 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00004.png new file mode 100644 index 0000000..800391f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00005.png new file mode 100644 index 0000000..3ec4b9f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00006.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00007.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00008.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00009.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00010.png b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00010.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_no_gtw2/00010.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00001.png new file mode 100644 index 0000000..d60eca6 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00002.png new file mode 100644 index 0000000..eba1f5c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00003.png new file mode 100644 index 0000000..b29f2d4 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00004.png new file mode 100644 index 0000000..2d228cc Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00005.png new file mode 100644 index 0000000..5626de9 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00006.png new file mode 100644 index 0000000..d001d84 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00007.png new file mode 100644 index 0000000..c0cee95 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00008.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00009.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00010.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00010.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00010.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00011.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00011.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00011.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_relock/00012.png b/tests/python/snapshots/nanos/test_sign_transaction_relock/00012.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_relock/00012.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00001.png new file mode 100644 index 0000000..1d66c38 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00002.png new file mode 100644 index 0000000..eba1f5c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00003.png new file mode 100644 index 0000000..b29f2d4 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00004.png new file mode 100644 index 0000000..2d228cc Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00005.png new file mode 100644 index 0000000..5626de9 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00006.png new file mode 100644 index 0000000..d001d84 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00007.png new file mode 100644 index 0000000..c0cee95 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00008.png new file mode 100644 index 0000000..a7c4e6c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00009.png new file mode 100644 index 0000000..bc741dd Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00010.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00010.png new file mode 100644 index 0000000..7aac2e5 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00010.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00011.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00011.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00011.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00012.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00012.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00012.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00013.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00013.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00013.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00014.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00014.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00014.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_revoke/00015.png b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00015.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_revoke/00015.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00001.png new file mode 100644 index 0000000..5adfa7b Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00002.png new file mode 100644 index 0000000..2b72a28 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00003.png new file mode 100644 index 0000000..85d5804 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00004.png new file mode 100644 index 0000000..800391f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00005.png new file mode 100644 index 0000000..3ec4b9f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00006.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00007.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00008.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00009.png new file mode 100644 index 0000000..9311e03 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00010.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00010.png new file mode 100644 index 0000000..4112824 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00010.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00011.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00011.png new file mode 100644 index 0000000..edecb87 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00011.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00012.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00012.png new file mode 100644 index 0000000..0e19496 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00012.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00013.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00013.png new file mode 100644 index 0000000..e3a54ff Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00013.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00014.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00014.png new file mode 100644 index 0000000..ddd5155 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00014.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00015.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00015.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00015.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00016.png b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00016.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_token_transfer/00016.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00001.png new file mode 100644 index 0000000..f937e19 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00002.png new file mode 100644 index 0000000..eba1f5c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00003.png new file mode 100644 index 0000000..b29f2d4 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00004.png new file mode 100644 index 0000000..2d228cc Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00005.png new file mode 100644 index 0000000..5626de9 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00006.png new file mode 100644 index 0000000..d001d84 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00007.png new file mode 100644 index 0000000..c0cee95 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00008.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00009.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00010.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00010.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00010.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00011.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00011.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00011.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_unlock/00012.png b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00012.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_unlock/00012.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00001.png new file mode 100644 index 0000000..4ce1ba3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00002.png new file mode 100644 index 0000000..eba1f5c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00003.png new file mode 100644 index 0000000..b29f2d4 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00004.png new file mode 100644 index 0000000..2d228cc Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00005.png new file mode 100644 index 0000000..5626de9 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00006.png new file mode 100644 index 0000000..d001d84 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00006.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00007.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00007.png new file mode 100644 index 0000000..c0cee95 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00007.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00008.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00008.png new file mode 100644 index 0000000..a7c4e6c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00008.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00009.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00009.png new file mode 100644 index 0000000..bc741dd Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00009.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00010.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00010.png new file mode 100644 index 0000000..7aac2e5 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00010.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00011.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00011.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00011.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00012.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00012.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00012.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00013.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00013.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00013.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00014.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00014.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00014.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_vote/00015.png b/tests/python/snapshots/nanos/test_sign_transaction_vote/00015.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_vote/00015.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00000.png b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00000.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00001.png b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00001.png new file mode 100644 index 0000000..f4832b0 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00001.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00002.png b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00002.png new file mode 100644 index 0000000..0130ea2 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00002.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00003.png b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00003.png new file mode 100644 index 0000000..30c9a48 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00003.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00004.png b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00004.png new file mode 100644 index 0000000..1b0400f Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00004.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00005.png b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00005.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00005.png differ diff --git a/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00006.png b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00006.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/python/snapshots/nanos/test_sign_transaction_withdraw/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_celo_derive_address/00000.png b/tests/python/snapshots/nanosp/test_celo_derive_address/00000.png new file mode 100644 index 0000000..a487005 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_celo_derive_address/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_celo_derive_address/00001.png b/tests/python/snapshots/nanosp/test_celo_derive_address/00001.png new file mode 100644 index 0000000..9a1af1f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_celo_derive_address/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_celo_derive_address/00002.png b/tests/python/snapshots/nanosp/test_celo_derive_address/00002.png new file mode 100644 index 0000000..53ae651 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_celo_derive_address/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_celo_derive_address/00003.png b/tests/python/snapshots/nanosp/test_celo_derive_address/00003.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_celo_derive_address/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_data/00000.png b/tests/python/snapshots/nanosp/test_sign_data/00000.png new file mode 100644 index 0000000..1b27154 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_data/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_data/00001.png b/tests/python/snapshots/nanosp/test_sign_data/00001.png new file mode 100644 index 0000000..763784d Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_data/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_data/00002.png b/tests/python/snapshots/nanosp/test_sign_data/00002.png new file mode 100644 index 0000000..e7ffedd Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_data/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_data/00003.png b/tests/python/snapshots/nanosp/test_sign_data/00003.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_data/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_activate/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_activate/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00001.png new file mode 100644 index 0000000..0786dec Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_activate/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00002.png new file mode 100644 index 0000000..97b8d7e Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_activate/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00003.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_activate/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00004.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_activate/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00005.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_activate/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_create/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_create/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_create/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_create/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_create/00001.png new file mode 100644 index 0000000..a10bf89 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_create/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_create/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_create/00002.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_create/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_create/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_create/00003.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_create/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_create/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_create/00004.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_create/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_empty/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_empty/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00001.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_empty/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00002.png new file mode 100644 index 0000000..15a8a4c Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_empty/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00003.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_empty/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00004.png new file mode 100644 index 0000000..60cc95a Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_empty/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00005.png new file mode 100644 index 0000000..561ba78 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_empty/00006.png b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00006.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_empty/00007.png b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00007.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_empty/00007.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_lock/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_lock/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00001.png new file mode 100644 index 0000000..d2fac22 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_lock/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00002.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_lock/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00003.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_lock/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00004.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_lock/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00005.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_lock/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00001.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00002.png new file mode 100644 index 0000000..15a8a4c Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00003.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00004.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00005.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00001.png new file mode 100644 index 0000000..8fc8955 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00002.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00003.png new file mode 100644 index 0000000..15a8a4c Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00004.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00006.png b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00006.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_no_gtw2/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_relock/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_relock/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00001.png new file mode 100644 index 0000000..d24661d Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_relock/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00002.png new file mode 100644 index 0000000..90445ef Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_relock/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00003.png new file mode 100644 index 0000000..a5de59f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_relock/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00004.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_relock/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_relock/00006.png b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00006.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_relock/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00001.png new file mode 100644 index 0000000..145f506 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00002.png new file mode 100644 index 0000000..90445ef Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00003.png new file mode 100644 index 0000000..a5de59f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00004.png new file mode 100644 index 0000000..97b8d7e Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00005.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00006.png b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00006.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00007.png b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00007.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_revoke/00007.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00001.png new file mode 100644 index 0000000..8fc8955 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00002.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00003.png new file mode 100644 index 0000000..15a8a4c Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00004.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00005.png new file mode 100644 index 0000000..60cc95a Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00006.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00006.png new file mode 100644 index 0000000..561ba78 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00007.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00007.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00007.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00008.png b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00008.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_token_transfer/00008.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00001.png new file mode 100644 index 0000000..0cb4b26 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00002.png new file mode 100644 index 0000000..90445ef Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00003.png new file mode 100644 index 0000000..a5de59f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00004.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00006.png b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00006.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_unlock/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_vote/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_vote/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00001.png new file mode 100644 index 0000000..069ed78 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_vote/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00002.png new file mode 100644 index 0000000..90445ef Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_vote/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00003.png new file mode 100644 index 0000000..a5de59f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_vote/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00004.png new file mode 100644 index 0000000..97b8d7e Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_vote/00005.png b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00005.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_vote/00006.png b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00006.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_vote/00007.png b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00007.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_vote/00007.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00000.png b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00001.png b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00001.png new file mode 100644 index 0000000..a84e600 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00002.png b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00002.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00003.png b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00003.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00004.png b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00004.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanosp/test_sign_transaction_withdraw/00004.png differ diff --git a/tests/python/snapshots/nanox/test_celo_derive_address/00000.png b/tests/python/snapshots/nanox/test_celo_derive_address/00000.png new file mode 100644 index 0000000..a487005 Binary files /dev/null and b/tests/python/snapshots/nanox/test_celo_derive_address/00000.png differ diff --git a/tests/python/snapshots/nanox/test_celo_derive_address/00001.png b/tests/python/snapshots/nanox/test_celo_derive_address/00001.png new file mode 100644 index 0000000..9a1af1f Binary files /dev/null and b/tests/python/snapshots/nanox/test_celo_derive_address/00001.png differ diff --git a/tests/python/snapshots/nanox/test_celo_derive_address/00002.png b/tests/python/snapshots/nanox/test_celo_derive_address/00002.png new file mode 100644 index 0000000..53ae651 Binary files /dev/null and b/tests/python/snapshots/nanox/test_celo_derive_address/00002.png differ diff --git a/tests/python/snapshots/nanox/test_celo_derive_address/00003.png b/tests/python/snapshots/nanox/test_celo_derive_address/00003.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_celo_derive_address/00003.png differ diff --git a/tests/python/snapshots/nanox/test_celo_derive_address/00004.png b/tests/python/snapshots/nanox/test_celo_derive_address/00004.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/python/snapshots/nanox/test_celo_derive_address/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_data/00000.png b/tests/python/snapshots/nanox/test_sign_data/00000.png new file mode 100644 index 0000000..1b27154 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_data/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_data/00001.png b/tests/python/snapshots/nanox/test_sign_data/00001.png new file mode 100644 index 0000000..763784d Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_data/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_data/00002.png b/tests/python/snapshots/nanox/test_sign_data/00002.png new file mode 100644 index 0000000..e7ffedd Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_data/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_data/00003.png b/tests/python/snapshots/nanox/test_sign_data/00003.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_data/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_activate/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_activate/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_activate/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_activate/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_activate/00001.png new file mode 100644 index 0000000..0786dec Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_activate/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_activate/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_activate/00002.png new file mode 100644 index 0000000..97b8d7e Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_activate/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_activate/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_activate/00003.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_activate/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_activate/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_activate/00004.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_activate/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_activate/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_activate/00005.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_activate/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_create/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_create/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_create/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_create/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_create/00001.png new file mode 100644 index 0000000..a10bf89 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_create/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_create/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_create/00002.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_create/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_create/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_create/00003.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_create/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_create/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_create/00004.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_create/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_empty/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_empty/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_empty/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_empty/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_empty/00001.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_empty/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_empty/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_empty/00002.png new file mode 100644 index 0000000..15a8a4c Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_empty/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_empty/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_empty/00003.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_empty/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_empty/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_empty/00004.png new file mode 100644 index 0000000..60cc95a Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_empty/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_empty/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_empty/00005.png new file mode 100644 index 0000000..561ba78 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_empty/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_empty/00006.png b/tests/python/snapshots/nanox/test_sign_transaction_empty/00006.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_empty/00006.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_empty/00007.png b/tests/python/snapshots/nanox/test_sign_transaction_empty/00007.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_empty/00007.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_lock/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_lock/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_lock/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_lock/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_lock/00001.png new file mode 100644 index 0000000..d2fac22 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_lock/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_lock/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_lock/00002.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_lock/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_lock/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_lock/00003.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_lock/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_lock/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_lock/00004.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_lock/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_lock/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_lock/00005.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_lock/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00001.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00002.png new file mode 100644 index 0000000..15a8a4c Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00003.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00004.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00005.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00001.png new file mode 100644 index 0000000..8fc8955 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00002.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00003.png new file mode 100644 index 0000000..15a8a4c Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00004.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00006.png b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00006.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_no_gtw2/00006.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_relock/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_relock/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_relock/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_relock/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_relock/00001.png new file mode 100644 index 0000000..d24661d Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_relock/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_relock/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_relock/00002.png new file mode 100644 index 0000000..90445ef Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_relock/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_relock/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_relock/00003.png new file mode 100644 index 0000000..a5de59f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_relock/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_relock/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_relock/00004.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_relock/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_relock/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_relock/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_relock/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_relock/00006.png b/tests/python/snapshots/nanox/test_sign_transaction_relock/00006.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_relock/00006.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_revoke/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_revoke/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00001.png new file mode 100644 index 0000000..145f506 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_revoke/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00002.png new file mode 100644 index 0000000..90445ef Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_revoke/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00003.png new file mode 100644 index 0000000..a5de59f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_revoke/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00004.png new file mode 100644 index 0000000..97b8d7e Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_revoke/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00005.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_revoke/00006.png b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00006.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00006.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_revoke/00007.png b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00007.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_revoke/00007.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00001.png new file mode 100644 index 0000000..8fc8955 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00002.png new file mode 100644 index 0000000..9250a42 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00003.png new file mode 100644 index 0000000..15a8a4c Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00004.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00005.png new file mode 100644 index 0000000..60cc95a Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00006.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00006.png new file mode 100644 index 0000000..561ba78 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00006.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00007.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00007.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00007.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00008.png b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00008.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_token_transfer/00008.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_unlock/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_unlock/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00001.png new file mode 100644 index 0000000..0cb4b26 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_unlock/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00002.png new file mode 100644 index 0000000..90445ef Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_unlock/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00003.png new file mode 100644 index 0000000..a5de59f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_unlock/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00004.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_unlock/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_unlock/00006.png b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00006.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_unlock/00006.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_vote/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_vote/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_vote/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_vote/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_vote/00001.png new file mode 100644 index 0000000..069ed78 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_vote/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_vote/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_vote/00002.png new file mode 100644 index 0000000..90445ef Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_vote/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_vote/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_vote/00003.png new file mode 100644 index 0000000..a5de59f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_vote/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_vote/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_vote/00004.png new file mode 100644 index 0000000..97b8d7e Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_vote/00004.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_vote/00005.png b/tests/python/snapshots/nanox/test_sign_transaction_vote/00005.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_vote/00005.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_vote/00006.png b/tests/python/snapshots/nanox/test_sign_transaction_vote/00006.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_vote/00006.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_vote/00007.png b/tests/python/snapshots/nanox/test_sign_transaction_vote/00007.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_vote/00007.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00000.png b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00000.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00001.png b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00001.png new file mode 100644 index 0000000..a84e600 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00001.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00002.png b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00002.png new file mode 100644 index 0000000..83fb84f Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00002.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00003.png b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00003.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00003.png differ diff --git a/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00004.png b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00004.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/python/snapshots/nanox/test_sign_transaction_withdraw/00004.png differ diff --git a/tests/python/snapshots/stax/test_celo_derive_address/00000.png b/tests/python/snapshots/stax/test_celo_derive_address/00000.png new file mode 100644 index 0000000..caf6009 Binary files /dev/null and b/tests/python/snapshots/stax/test_celo_derive_address/00000.png differ diff --git a/tests/python/snapshots/stax/test_celo_derive_address/00001.png b/tests/python/snapshots/stax/test_celo_derive_address/00001.png new file mode 100644 index 0000000..0c8de85 Binary files /dev/null and b/tests/python/snapshots/stax/test_celo_derive_address/00001.png differ diff --git a/tests/python/snapshots/stax/test_celo_derive_address/00002.png b/tests/python/snapshots/stax/test_celo_derive_address/00002.png new file mode 100644 index 0000000..92b8843 Binary files /dev/null and b/tests/python/snapshots/stax/test_celo_derive_address/00002.png differ diff --git a/tests/python/snapshots/stax/test_celo_derive_address/00003.png b/tests/python/snapshots/stax/test_celo_derive_address/00003.png new file mode 100644 index 0000000..0c8de85 Binary files /dev/null and b/tests/python/snapshots/stax/test_celo_derive_address/00003.png differ diff --git a/tests/python/snapshots/stax/test_celo_derive_address/00004.png b/tests/python/snapshots/stax/test_celo_derive_address/00004.png new file mode 100644 index 0000000..b69649a Binary files /dev/null and b/tests/python/snapshots/stax/test_celo_derive_address/00004.png differ diff --git a/tests/python/snapshots/stax/test_celo_derive_address/00005.png b/tests/python/snapshots/stax/test_celo_derive_address/00005.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_celo_derive_address/00005.png differ diff --git a/tests/python/snapshots/stax/test_sign_data/00000.png b/tests/python/snapshots/stax/test_sign_data/00000.png new file mode 100644 index 0000000..057744d Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_data/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_data/00001.png b/tests/python/snapshots/stax/test_sign_data/00001.png new file mode 100644 index 0000000..57e1c74 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_data/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_data/00002.png b/tests/python/snapshots/stax/test_sign_data/00002.png new file mode 100644 index 0000000..c7c89cb Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_data/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_data/00003.png b/tests/python/snapshots/stax/test_sign_data/00003.png new file mode 100644 index 0000000..b1bf4dd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_data/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_data/00004.png b/tests/python/snapshots/stax/test_sign_data/00004.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_data/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_activate/00000.png b/tests/python/snapshots/stax/test_sign_transaction_activate/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_activate/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_activate/00001.png b/tests/python/snapshots/stax/test_sign_transaction_activate/00001.png new file mode 100644 index 0000000..c213847 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_activate/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_activate/00002.png b/tests/python/snapshots/stax/test_sign_transaction_activate/00002.png new file mode 100644 index 0000000..d8ea2f0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_activate/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_activate/00003.png b/tests/python/snapshots/stax/test_sign_transaction_activate/00003.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_activate/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_activate/00004.png b/tests/python/snapshots/stax/test_sign_transaction_activate/00004.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_activate/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_create/00000.png b/tests/python/snapshots/stax/test_sign_transaction_create/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_create/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_create/00001.png b/tests/python/snapshots/stax/test_sign_transaction_create/00001.png new file mode 100644 index 0000000..d8ada22 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_create/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_create/00002.png b/tests/python/snapshots/stax/test_sign_transaction_create/00002.png new file mode 100644 index 0000000..d8ea2f0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_create/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_create/00003.png b/tests/python/snapshots/stax/test_sign_transaction_create/00003.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_create/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_create/00004.png b/tests/python/snapshots/stax/test_sign_transaction_create/00004.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_create/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_empty/00000.png b/tests/python/snapshots/stax/test_sign_transaction_empty/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_empty/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_empty/00001.png b/tests/python/snapshots/stax/test_sign_transaction_empty/00001.png new file mode 100644 index 0000000..5145a2e Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_empty/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_empty/00002.png b/tests/python/snapshots/stax/test_sign_transaction_empty/00002.png new file mode 100644 index 0000000..de2782e Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_empty/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_empty/00003.png b/tests/python/snapshots/stax/test_sign_transaction_empty/00003.png new file mode 100644 index 0000000..82e63a0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_empty/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_empty/00004.png b/tests/python/snapshots/stax/test_sign_transaction_empty/00004.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_empty/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_empty/00005.png b/tests/python/snapshots/stax/test_sign_transaction_empty/00005.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_empty/00005.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_lock/00000.png b/tests/python/snapshots/stax/test_sign_transaction_lock/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_lock/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_lock/00001.png b/tests/python/snapshots/stax/test_sign_transaction_lock/00001.png new file mode 100644 index 0000000..f625ffc Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_lock/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_lock/00002.png b/tests/python/snapshots/stax/test_sign_transaction_lock/00002.png new file mode 100644 index 0000000..d8ea2f0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_lock/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_lock/00003.png b/tests/python/snapshots/stax/test_sign_transaction_lock/00003.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_lock/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_lock/00004.png b/tests/python/snapshots/stax/test_sign_transaction_lock/00004.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_lock/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00000.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00001.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00001.png new file mode 100644 index 0000000..6edce85 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00002.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00002.png new file mode 100644 index 0000000..d8ea2f0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00003.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00003.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00004.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00004.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00000.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00001.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00001.png new file mode 100644 index 0000000..6b45815 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00002.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00002.png new file mode 100644 index 0000000..6edce85 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00003.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00003.png new file mode 100644 index 0000000..d8ea2f0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00004.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00004.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00005.png b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00005.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_no_gtw2/00005.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_relock/00000.png b/tests/python/snapshots/stax/test_sign_transaction_relock/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_relock/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_relock/00001.png b/tests/python/snapshots/stax/test_sign_transaction_relock/00001.png new file mode 100644 index 0000000..3872cc7 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_relock/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_relock/00002.png b/tests/python/snapshots/stax/test_sign_transaction_relock/00002.png new file mode 100644 index 0000000..18ad36d Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_relock/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_relock/00003.png b/tests/python/snapshots/stax/test_sign_transaction_relock/00003.png new file mode 100644 index 0000000..82e63a0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_relock/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_relock/00004.png b/tests/python/snapshots/stax/test_sign_transaction_relock/00004.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_relock/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_relock/00005.png b/tests/python/snapshots/stax/test_sign_transaction_relock/00005.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_relock/00005.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_revoke/00000.png b/tests/python/snapshots/stax/test_sign_transaction_revoke/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_revoke/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_revoke/00001.png b/tests/python/snapshots/stax/test_sign_transaction_revoke/00001.png new file mode 100644 index 0000000..59db859 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_revoke/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_revoke/00002.png b/tests/python/snapshots/stax/test_sign_transaction_revoke/00002.png new file mode 100644 index 0000000..97ca1b1 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_revoke/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_revoke/00003.png b/tests/python/snapshots/stax/test_sign_transaction_revoke/00003.png new file mode 100644 index 0000000..82e63a0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_revoke/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_revoke/00004.png b/tests/python/snapshots/stax/test_sign_transaction_revoke/00004.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_revoke/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_revoke/00005.png b/tests/python/snapshots/stax/test_sign_transaction_revoke/00005.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_revoke/00005.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00000.png b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00001.png b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00001.png new file mode 100644 index 0000000..6b45815 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00002.png b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00002.png new file mode 100644 index 0000000..5145a2e Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00003.png b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00003.png new file mode 100644 index 0000000..de2782e Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00004.png b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00004.png new file mode 100644 index 0000000..82e63a0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00005.png b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00005.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00005.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00006.png b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00006.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_token_transfer/00006.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_unlock/00000.png b/tests/python/snapshots/stax/test_sign_transaction_unlock/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_unlock/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_unlock/00001.png b/tests/python/snapshots/stax/test_sign_transaction_unlock/00001.png new file mode 100644 index 0000000..541e536 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_unlock/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_unlock/00002.png b/tests/python/snapshots/stax/test_sign_transaction_unlock/00002.png new file mode 100644 index 0000000..18ad36d Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_unlock/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_unlock/00003.png b/tests/python/snapshots/stax/test_sign_transaction_unlock/00003.png new file mode 100644 index 0000000..82e63a0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_unlock/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_unlock/00004.png b/tests/python/snapshots/stax/test_sign_transaction_unlock/00004.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_unlock/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_unlock/00005.png b/tests/python/snapshots/stax/test_sign_transaction_unlock/00005.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_unlock/00005.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_vote/00000.png b/tests/python/snapshots/stax/test_sign_transaction_vote/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_vote/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_vote/00001.png b/tests/python/snapshots/stax/test_sign_transaction_vote/00001.png new file mode 100644 index 0000000..5d69244 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_vote/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_vote/00002.png b/tests/python/snapshots/stax/test_sign_transaction_vote/00002.png new file mode 100644 index 0000000..97ca1b1 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_vote/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_vote/00003.png b/tests/python/snapshots/stax/test_sign_transaction_vote/00003.png new file mode 100644 index 0000000..82e63a0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_vote/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_vote/00004.png b/tests/python/snapshots/stax/test_sign_transaction_vote/00004.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_vote/00004.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_vote/00005.png b/tests/python/snapshots/stax/test_sign_transaction_vote/00005.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_vote/00005.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_withdraw/00000.png b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00000.png new file mode 100644 index 0000000..c7270bd Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00000.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_withdraw/00001.png b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00001.png new file mode 100644 index 0000000..cdd0268 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00001.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_withdraw/00002.png b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00002.png new file mode 100644 index 0000000..d8ea2f0 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00002.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_withdraw/00003.png b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00003.png new file mode 100644 index 0000000..275de9a Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00003.png differ diff --git a/tests/python/snapshots/stax/test_sign_transaction_withdraw/00004.png b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00004.png new file mode 100644 index 0000000..3966189 Binary files /dev/null and b/tests/python/snapshots/stax/test_sign_transaction_withdraw/00004.png differ diff --git a/tests/python/test_celo.py b/tests/python/test_celo.py new file mode 100644 index 0000000..7559ebc --- /dev/null +++ b/tests/python/test_celo.py @@ -0,0 +1,62 @@ +from pathlib import Path + +from .apps.celo import CeloClient, StatusCode +from .apps.celo_utils import CELO_PACKED_DERIVATION_PATH +from .utils import get_async_response, get_nano_review_instructions, get_stax_review_instructions, get_stax_review_instructions_with_warning +from ragger.navigator import NavInsID, NavIns + +import pytest + +TESTS_ROOT_DIR = Path(__file__).parent + + +@pytest.mark.parametrize("show", [False, True]) +@pytest.mark.parametrize("chaincode", [False, True]) +def test_celo_derive_address(test_name, backend, firmware, show, chaincode, navigator): + celo = CeloClient(backend) + + if firmware.device == "nanos": + instructions = get_nano_review_instructions(4) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(2) + else: + instructions = [ + NavIns(NavInsID.USE_CASE_CHOICE_CONFIRM), + NavIns(NavInsID.TOUCH, (200, 335)), + NavIns(NavInsID.USE_CASE_ADDRESS_CONFIRMATION_EXIT_QR), + NavIns(NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CONFIRM), + NavIns(NavInsID.USE_CASE_STATUS_DISMISS) + ] + + with celo.derive_address_async(CELO_PACKED_DERIVATION_PATH, show, chaincode): + if show: + navigator.navigate_and_compare(TESTS_ROOT_DIR, + test_name, + instructions) + + response: bytes = get_async_response(backend) + + assert (response.status == StatusCode.STATUS_OK) + + +def test_celo_get_version(backend, firmware): + celo = CeloClient(backend) + response = celo.get_version() + + assert (response.status == StatusCode.STATUS_OK) + + +def test_sign_data(test_name, backend, firmware, navigator): + celo = CeloClient(backend) + if firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(2) + else: + instructions = get_stax_review_instructions(1) + + with celo.sign_data_async(CELO_PACKED_DERIVATION_PATH, "1234567890"): + navigator.navigate_and_compare(TESTS_ROOT_DIR, test_name, instructions) + + response: bytes = get_async_response(backend) + + assert (response.status == StatusCode.STATUS_OK) + assert (len(response.data) == 65) diff --git a/tests/python/test_sign_transaction.py b/tests/python/test_sign_transaction.py new file mode 100644 index 0000000..49c8e1c --- /dev/null +++ b/tests/python/test_sign_transaction.py @@ -0,0 +1,212 @@ +from pathlib import Path +from .apps.celo import CeloClient, StatusCode +from .apps.celo_utils import CELO_PACKED_DERIVATION_PATH +from .utils import get_async_response, get_nano_review_instructions, get_stax_review_instructions, get_stax_review_instructions_with_warning + +TESTS_ROOT_DIR = Path(__file__).parent + +TOKEN_TRANSFER_ID = 0xa9059cbb +TOKEN_TRANSFER_WITH_COMMENT_ID = 0xe1d6aceb +LOCK_METHOD_ID = 0xf83d08ba +VOTE_METHOD_ID = 0x580d747a +ACTIVATE_METHOD_ID = 0x1c5a9d9c +REVOKE_PENDING_METHOD_ID = 0x9dfb6081 +REVOKE_ACTIVE_METHOD_ID = 0x6e198475 +UNLOCK_METHOD_ID = 0x6198e339 +WITHDRAW_METHOD_ID = 0x2e1a7d4d +RELOCK_METHOD_ID = 0xb2fb30cb +CREATE_ACCOUNT_METHOD_ID = 0x9dca362f + + +def sign_transaction(test_name, backend, navigator, instructions, payload): + celo = CeloClient(backend) + with celo.sign_transaction_async(CELO_PACKED_DERIVATION_PATH, + [ + "1234", #Nonce + "1234", #GasPrice + "1234", #StartGas + "", #FeeCurrency + "12345678901234567890", #GatewayTo + "1234", #GatewayFee + "12345678901234567890", #To + "", #Value + payload, + "", #V + "", #R + "", #S + "" #Done + ] + ): + navigator.navigate_and_compare(TESTS_ROOT_DIR, test_name, instructions) + response: bytes = get_async_response(backend) + + assert (response.status == StatusCode.STATUS_OK) + + +def sign_transaction_no_gtw(test_name, backend, navigator, instructions, payload): + celo = CeloClient(backend) + with celo.sign_transaction_async(CELO_PACKED_DERIVATION_PATH, + [ + "1234", #Nonce + "1234", #GasPrice + "1234", #StartGas + "", #FeeCurrency + "", #GatewayTo + "1234", #GatewayFee + "12345678901234567890", #To + "", #Value + payload, + "", #V + "", #R + "", #S + "" #Done + ] + ): + navigator.navigate_and_compare(TESTS_ROOT_DIR, test_name, instructions) + response: bytes = get_async_response(backend) + + assert (response.status == StatusCode.STATUS_OK) + + +def test_sign_transaction_empty(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(14) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(6) + else: + instructions = get_stax_review_instructions(2) + payload = "" + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_token_transfer(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(15) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(7) + else: + instructions = get_stax_review_instructions_with_warning(2) + payload = TOKEN_TRANSFER_ID.to_bytes(4, byteorder='big') + b'00' * 32 + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_lock(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(6) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(4) + else: + instructions = get_stax_review_instructions(1) + payload = LOCK_METHOD_ID.to_bytes(4, byteorder='big') + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_vote(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(14) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(6) + else: + instructions = get_stax_review_instructions(2) + payload = VOTE_METHOD_ID.to_bytes(4, byteorder='big') + b'00' * 64 + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_activate(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(8) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(4) + else: + instructions = get_stax_review_instructions(1) + payload = ACTIVATE_METHOD_ID.to_bytes(4, byteorder='big') + b'00' * 16 + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_revoke(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(14) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(6) + else: + instructions = get_stax_review_instructions(2) + payload = REVOKE_PENDING_METHOD_ID.to_bytes(4, byteorder='big') + b'00' * 80 + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_unlock(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(11) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(5) + else: + instructions = get_stax_review_instructions(2) + payload = UNLOCK_METHOD_ID.to_bytes(4, byteorder='big') + b'00' * 16 + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_withdraw(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(5) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(3) + else: + instructions = get_stax_review_instructions(1) + payload = WITHDRAW_METHOD_ID.to_bytes(4, byteorder='big') + b'00' * 16 + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_relock(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(11) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(5) + else: + instructions = get_stax_review_instructions(2) + payload = RELOCK_METHOD_ID.to_bytes(4, byteorder='big') + b'00' * 32 + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_create(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(5) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(3) + else: + instructions = get_stax_review_instructions(1) + payload = CREATE_ACCOUNT_METHOD_ID.to_bytes(4, byteorder='big') + + sign_transaction(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_no_gtw(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(8) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(4) + else: + instructions = get_stax_review_instructions(1) + + payload = "" + sign_transaction_no_gtw(test_name, backend, navigator, instructions, payload) + + +def test_sign_transaction_no_gtw2(test_name, backend, firmware, navigator): + if firmware.device == "nanos": + instructions = get_nano_review_instructions(9) + elif firmware.device.startswith("nano"): + instructions = get_nano_review_instructions(5) + else: + instructions = get_stax_review_instructions_with_warning(1) + + payload = "1234" + sign_transaction_no_gtw(test_name, backend, navigator, instructions, payload) diff --git a/tests/python/utils.py b/tests/python/utils.py new file mode 100644 index 0000000..5c6dc8b --- /dev/null +++ b/tests/python/utils.py @@ -0,0 +1,50 @@ +from bip32 import HARDENED_INDEX + +from ragger.backend import SpeculosBackend +from ragger.navigator import NavInsID, NavIns +from ragger.backend.interface import RAPDU + + +def get_nano_review_instructions(num_screen_skip): + instructions = [NavIns(NavInsID.RIGHT_CLICK)] * num_screen_skip + instructions.append(NavIns(NavInsID.BOTH_CLICK)) + return instructions + + +def get_stax_review_instructions(num_screen_skip): + instructions = [NavIns(NavInsID.USE_CASE_CHOICE_CONFIRM)] + + for i in range(num_screen_skip): + instructions.append(NavIns(NavInsID.USE_CASE_REVIEW_TAP)) + + instructions.append(NavIns(NavInsID.USE_CASE_REVIEW_CONFIRM)) + instructions.append(NavIns(NavInsID.USE_CASE_STATUS_DISMISS)) + return instructions + + +def get_stax_review_instructions_with_warning(num_screen_skip): + instructions = [NavIns(NavInsID.USE_CASE_CHOICE_CONFIRM)] + instructions.append(NavIns(NavInsID.USE_CASE_CHOICE_CONFIRM)) + + for i in range(num_screen_skip): + instructions.append(NavIns(NavInsID.USE_CASE_REVIEW_TAP)) + + instructions.append(NavIns(NavInsID.USE_CASE_REVIEW_CONFIRM)) + instructions.append(NavIns(NavInsID.USE_CASE_STATUS_DISMISS)) + return instructions + + +def get_async_response(backend: SpeculosBackend) -> RAPDU: + return backend.last_async_response + + +def pack_derivation_path(derivation_path: str) -> bytes: + split = derivation_path.split("/") + assert split.pop(0) == "m", "master expected" + derivation_path: bytes = (len(split)).to_bytes(1, byteorder='big') + for i in split: + if (i[-1] == "'"): + derivation_path += (int(i[:-1]) | HARDENED_INDEX).to_bytes(4, byteorder='big') + else: + derivation_path += int(i).to_bytes(4, byteorder='big') + return derivation_path diff --git a/tests/CMakeLists.txt b/tests/unit/CMakeLists.txt similarity index 94% rename from tests/CMakeLists.txt rename to tests/unit/CMakeLists.txt index 90df97d..af3b6f0 100644 --- a/tests/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -8,7 +8,7 @@ enable_testing() add_compile_definitions(TESTING) -set(COMMON_SRC "../src_common") +set(COMMON_SRC "../../src_common") include_directories(${COMMON_SRC}) add_executable(test_uint256 diff --git a/tests/test_tx_parser.c b/tests/unit/test_tx_parser.c similarity index 100% rename from tests/test_tx_parser.c rename to tests/unit/test_tx_parser.c diff --git a/tests/test_uint256.c b/tests/unit/test_uint256.c similarity index 100% rename from tests/test_uint256.c rename to tests/unit/test_uint256.c