Skip to content

Commit

Permalink
Merge pull request #12 from blooo-io/feat/adding-flex-support
Browse files Browse the repository at this point in the history
Feature - Adding support to Flex device
  • Loading branch information
Z4karia authored Aug 22, 2024
2 parents 1fbdfdd + 0e8e369 commit 5b0d12d
Show file tree
Hide file tree
Showing 27 changed files with 22 additions and 10 deletions.
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ APP_LOAD_PARAMS= --curve secp256k1 $(COMMON_LOAD_PARAMS)

APPVERSION_M=1
APPVERSION_N=2
APPVERSION_P=3
APPVERSION_P=4
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)

# Celo
Expand All @@ -34,16 +34,18 @@ APP_LOAD_PARAMS += --path "44'/60'/0'/0/0" --path "44'/60'/0'" --path "44'/60'/0

APPNAME = "Celo"
APP_LOAD_FLAGS=--appFlags 0
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX TARGET_FLEX))
APP_LOAD_FLAGS=--appFlags 0x200 # APPLICATION_FLAG_BOLOS_SETTINGS
endif
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)
else ifeq ($(TARGET_NAME), TARGET_STAX)
ICONNAME=stax_app_celo.gif
else ifeq ($(TARGET_NAME), TARGET_FLEX)
ICONNAME=flex_app_celo.gif
else
ICONNAME=nanox_app_celo.gif
endif
Expand Down Expand Up @@ -75,7 +77,7 @@ DEFINES += APPVERSION=\"$(APPVERSION)\"

DEFINES += HAVE_WEBUSB WEBUSB_URL_SIZE_B=0 WEBUSB_URL=""

ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX TARGET_FLEX))
DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000
DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE
endif
Expand All @@ -86,7 +88,7 @@ else
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300
endif

ifeq ($(TARGET_NAME),TARGET_STAX)
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_FLEX TARGET_STAX))
DEFINES += NBGL_QRCODE
SDK_SOURCE_PATH += qrcode
else
Expand Down Expand Up @@ -152,11 +154,11 @@ include $(BOLOS_SDK)/Makefile.glyphs
APP_SOURCE_PATH += src_common src
SDK_SOURCE_PATH += lib_stusb lib_stusb_impl lib_u2f

ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX TARGET_FLEX))
SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl
endif

ifneq ($(TARGET_NAME),TARGET_STAX)
ifneq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_FLEX TARGET_STAX))
SDK_SOURCE_PATH += lib_ux
endif

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Celo app for Ledger Wallet

This app adds support for the Celo native token for the Ledger Nano S/X/SP and Stax.
This app adds support for the Celo native token for the Ledger Nano S/X/SP/Stax and Flex.

## Quick start guide

Expand Down Expand Up @@ -80,6 +80,7 @@ You can choose which device to compile and load for by setting the `BOLOS_SDK` e
- `BOLOS_SDK=$NANOX_SDK`
- `BOLOS_SDK=$NANOSP_SDK`
- `BOLOS_SDK=$STAX_SDK`
- `BOLOS_SDK=$FLEX_SDK`

By default this variable is set to build/load for Nano S.

Expand Down Expand Up @@ -206,3 +207,4 @@ It outputs 3 artifacts:
- `compiled_app_binaries` within binary files of the build process for each device
- `code-coverage` within HTML details of code coverage
- `documentation` within HTML auto-generated documentation

Binary file added flex_app_celo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ledger_app.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[app]
build_directory = "./"
sdk = "C"
devices = ["nanos", "nanox", "nanos+", "stax"]
devices = ["nanos", "nanox", "nanos+", "stax", "flex"]

[tests]
unit_directory = "./tests/unit"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion tests/python/test_celo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ def test_celo_derive_address(test_name, backend, firmware, show, chaincode, navi
instructions = get_nano_review_instructions(4)
elif firmware.device.startswith("nano"):
instructions = get_nano_review_instructions(2)
else:
elif firmware.device == "stax":
instructions = [
NavIns(NavInsID.SWIPE_CENTER_TO_LEFT),
NavIns(NavInsID.TOUCH, (64, 521)),
NavIns(NavInsID.USE_CASE_ADDRESS_CONFIRMATION_EXIT_QR),
NavIns(NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CONFIRM),
NavIns(NavInsID.USE_CASE_STATUS_DISMISS)
]
else:
instructions = [
NavIns(NavInsID.SWIPE_CENTER_TO_LEFT),
NavIns(NavInsID.TOUCH, (76, 463)),
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:
Expand Down

0 comments on commit 5b0d12d

Please sign in to comment.