Skip to content

Commit

Permalink
Merge pull request #15 from blooo-io/fix/implement-ledger-requirements
Browse files Browse the repository at this point in the history
Fix: implement ledger's requirements
  • Loading branch information
keiff3r authored Oct 10, 2024
2 parents e8f4372 + 1dbac9e commit d4b1f75
Show file tree
Hide file tree
Showing 78 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 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=3
APPVERSION_P=0
APPVERSION_P=1
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)

# Celo
Expand Down
Binary file modified glyphs/celo_64px.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 src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ __attribute__((section(".boot"))) int main(void) {

if (N_storage.initialized != 0x01) {
internalStorage_t storage;
storage.dataAllowed = 0x01;
storage.dataAllowed = 0x00;
storage.contractDetails = 0x00;
storage.initialized = 0x01;
nvm_write(&N_storage, (void*)&storage, sizeof(internalStorage_t));
Expand Down
2 changes: 1 addition & 1 deletion tests/python/apps/celo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class INS(IntEnum):
class StatusCode(IntEnum):
STATUS_OK = 0x9000
STATUS_DEPRECATED = 0x6501

STATUS_ERROR_IN_DATA = 0x6A80

class Param(IntEnum):
P1_DirectlyFetchAddress = 0x00 # Return address directly from the wallet
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/python/snapshots/flex/test_celo_derive_address/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/python/snapshots/flex/test_sign_data/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/python/snapshots/flex/test_sign_data/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/python/snapshots/flex/test_sign_data/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/python/snapshots/flex/test_sign_data/00004.png
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified tests/python/snapshots/stax/test_celo_derive_address/00000.png
Binary file modified tests/python/snapshots/stax/test_celo_derive_address/00001.png
Binary file modified tests/python/snapshots/stax/test_celo_derive_address/00003.png
Binary file modified tests/python/snapshots/stax/test_celo_derive_address/00005.png
Binary file modified tests/python/snapshots/stax/test_sign_data/00000.png
Binary file modified tests/python/snapshots/stax/test_sign_data/00002.png
Binary file modified tests/python/snapshots/stax/test_sign_data/00004.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
29 changes: 20 additions & 9 deletions tests/python/test_sign_new_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,30 @@ def sign_transaction_with_rawTx(test_name, backend, navigator, instructions, raw
navigator.navigate_and_compare(TESTS_ROOT_DIR, test_name, instructions)

response: bytes = get_async_response(backend)
return response.status

assert (response.status == StatusCode.STATUS_OK)

def test_sign_transaction_eip1559(test_name, backend, firmware, navigator):
def test_sign_transaction_eip1559_no_data(test_name, backend, firmware, navigator):
if firmware.device == "nanos":
instructions = get_nano_review_instructions(9)
instructions = get_nano_review_instructions(6)
elif firmware.device.startswith("nano"):
instructions = get_nano_review_instructions(5)
instructions = get_nano_review_instructions(4)
else:
instructions = get_stax_review_instructions_with_warning(1)
instructions = get_stax_review_instructions(1)

rawTx = "02f86c82aef380830f42408506fc35fb8082520894da52c9ffebd4d54c94a072776126069d43e74f9e8080c080a099059ce0f1fe1f4fe27a583a6fd6a12274780d358f332d6e5901953900b8fb22a046ce6d625369fdc8a521c22793d188afbf61500cd3095fc09b761b518560f101"
status = sign_transaction_with_rawTx(test_name, backend, navigator, instructions, rawTx)

assert(status == StatusCode.STATUS_OK)

def test_sign_transaction_eip1559_with_data(test_name, backend, firmware):
rawTx = "02f8d482a4ec820808839b34b4850fbc63d144830204e094004626a008b1acdc4c74ab51644093b155e59a2380b864ba0876520000000000000000000000000000000000000000000000009458660c5b865f23000000000000000000000000e3b72489968f11c15282514f33df24634440393f000000000000000000000000e3b72489968f11c15282514f33df24634440393fc001a0b0799073a2aa771c5e32b88933ff19982dc30f9e4523fde47137ae504793b880a07014a6e3c32a3b34d4118beb298f2200e858599b5e97766dfaa6fea192cde993"
sign_transaction_with_rawTx(test_name, backend, navigator, instructions, rawTx)
celo = CeloClient(backend)
with pytest.raises(Exception) as exc_info: # Expecting the test to fail
with celo.sign_transaction_with_rawTx_async(ETH_PACKED_DERIVATION_PATH, rawTx):
pass
assert "6a80" in str(exc_info.value), "Expected exception to contain '6a80'"



def test_add_cUSD_as_fee_currency(test_name, backend, navigator):
celo = CeloClient(backend)
Expand All @@ -47,7 +58,6 @@ def test_add_cUSD_as_fee_currency(test_name, backend, navigator):
pass

response: bytes = get_async_response(backend)

assert (response.status == StatusCode.STATUS_OK)

def test_sign_transaction_cip64(test_name, backend, firmware, navigator):
Expand All @@ -61,4 +71,5 @@ def test_sign_transaction_cip64(test_name, backend, firmware, navigator):
instructions = get_stax_review_instructions(1)

rawTx = "7bf84382a4ec8084773594008503a11f9db58301688c94da52c9ffebd4d54c94a072776126069d43e74f9e8080c094765DE816845861E75A25FCA122BB6898B8B1282A018080"
sign_transaction_with_rawTx(test_name, backend, navigator, instructions, rawTx)
status = sign_transaction_with_rawTx(test_name, backend, navigator, instructions, rawTx)
assert(status == StatusCode.STATUS_OK)

0 comments on commit d4b1f75

Please sign in to comment.