diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 5d039b0c..daee8b52 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -33,6 +33,18 @@ static bool set_amount_ui_uint8(ethQueryContractUI_t *msg, return amountToString(amount, INT256_LENGTH, decimals, ticker, msg->msg, msg->msgLength); } +// Set UI with custom title for amount (Lisk L1) screen with uint8 data. +static bool set_amount_l1_ui_uint8(ethQueryContractUI_t *msg, + const uint8_t *amount, + const char *title) { + strlcpy(msg->title, title, msg->titleLength); + + uint8_t decimals = 8; + const char *ticker = "LSK"; + + return amountToString(amount, INT256_LENGTH, decimals, ticker, msg->msg, msg->msgLength); +} + // Set UI with custom title for amount screen with uint8 data. static bool set_amount_ui_arr(ethQueryContractUI_t *msg, const arr_uint8_t *amount, @@ -125,7 +137,7 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { case CLAIM_REGULAR_ACCOUNT: switch (msg->screenIndex) { case 0: - ret = set_amount_ui_uint8(msg, + ret = set_amount_l1_ui_uint8(msg, context->lisk.body.claim.claim_amount, "Claim LSK"); break; @@ -144,7 +156,7 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { case CLAIM_MULTI_SIGNATURE_ACCOUNT: switch (msg->screenIndex) { case 0: - ret = set_amount_ui_uint8(msg, + ret = set_amount_l1_ui_uint8(msg, context->lisk.body.claim.claim_amount, "Claim LSK"); break; diff --git a/tests/test_airdrop.py b/tests/test_airdrop.py index 07808cd3..e4df1f17 100644 --- a/tests/test_airdrop.py +++ b/tests/test_airdrop.py @@ -9,7 +9,7 @@ def test_claim_airdrop(backend, firmware, navigator, test_name, wallet_addr): data = contract.encodeABI("claimAirdrop", [ bytes.fromhex("77abc2dd8ca5021dbb8e91e63f574b1e440764d2"), - 4915507196, + 20000000000000000000, [ bytes.fromhex("9ca797d905e78f38685b61f62521632ef486bc6ce3e707d2af41b7fe146303c1"), ] diff --git a/tests/test_claim.py b/tests/test_claim.py index e575a37f..bfb00466 100644 --- a/tests/test_claim.py +++ b/tests/test_claim.py @@ -17,7 +17,7 @@ def test_claim_regular_account(backend, firmware, navigator, test_name, wallet_a bytes.fromhex("6f3f752b8381917128bc5145128af0d83e3d7547c83a2d28b20bb04b8952f4a6") ], bytes.fromhex("f83c23fb2532ad248e107ebd5312f1f78f742488fdec815c94d6b63aa7682eb6"), - 86511774, + 1000000000, # 10 LSK to be claimed bytes.fromhex("00bb7b59073f45177edf430090d5aa3c44aa7f23"), ( bytes.fromhex("664272cc25b0d20adf551b7a015795b9ad4ab23a4a19a509642bc042c00e5256"), @@ -37,7 +37,7 @@ def test_claim_multisig_account(backend, firmware, navigator, test_name, wallet_ bytes.fromhex("629779421eb7409cb867a7d8ee45aadc89a8b86f24423b737e1430832a78f026") ], bytes.fromhex("77abc2dd8ca5021dbb8e91e63f574b1e440764d2"), - 4915507196, + 1000000000, # 10 LSK to be claimed ( [ ], diff --git a/tests/test_reward.py b/tests/test_reward.py index ead9a850..e32a7d47 100644 --- a/tests/test_reward.py +++ b/tests/test_reward.py @@ -8,7 +8,7 @@ def test_create_position(backend, firmware, navigator, test_name, wallet_addr): data = contract.encodeABI("createPosition", [ - 86511774, + 200000000000000000, 100 ])