Skip to content

Commit

Permalink
Merge pull request #24 from Zondax/fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala authored Jun 5, 2023
2 parents f533b10 + 8087e5a commit 83bbcb2
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
[ ${{needs.build_ledger.outputs.size}} -le $NANOS_LIMIT_SIZE ]
test_zemu:
timeout-minutes: 15
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=2
# This is the `spec_version` field of `Runtime`
APPVERSION_N=1
# This is the patch version of this release
APPVERSION_P=6
APPVERSION_P=7
18 changes: 9 additions & 9 deletions app/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static parser_error_t parser_printCommonParams(const parser_tx_t *parser_tx_obj,
switch (displayIdx) {
case IDX_COMMON_SENDER:
snprintf(outKey, outKeyLen, "Sender");
if (!encodePubKey((uint8_t*) buff, sizeof(buff), parser_tx_obj->sender)) {
if (encodePubKey((uint8_t*) buff, sizeof(buff), parser_tx_obj->sender) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, buff, pageIdx, pageCount);
Expand All @@ -145,7 +145,7 @@ static parser_error_t parser_printCommonParams(const parser_tx_t *parser_tx_obj,
const char warning[9] = "WARNING: ";
const uint8_t warning_size = strnlen(warning, 9);
MEMCPY(buff, warning, warning_size);
if (!encodePubKey((uint8_t*) (buff + warning_size), sizeof(buff) - warning_size, parser_tx_obj->rekey)) {
if (encodePubKey((uint8_t*) (buff + warning_size), sizeof(buff) - warning_size, parser_tx_obj->rekey) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, buff, pageIdx, pageCount);
Expand Down Expand Up @@ -218,7 +218,7 @@ static parser_error_t parser_printTxPayment(const txn_payment *payment,
switch (displayIdx) {
case IDX_PAYMENT_RECEIVER:
snprintf(outKey, outKeyLen, "Receiver");
if (!encodePubKey((uint8_t*) buff, sizeof(buff), payment->receiver)) {
if (encodePubKey((uint8_t*) buff, sizeof(buff), payment->receiver) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, buff, pageIdx, pageCount);
Expand All @@ -232,7 +232,7 @@ static parser_error_t parser_printTxPayment(const txn_payment *payment,

case IDX_PAYMENT_CLOSE_TO:
snprintf(outKey, outKeyLen, "Close to");
if (!encodePubKey((uint8_t*) buff, sizeof(buff), payment->close)) {
if (encodePubKey((uint8_t*) buff, sizeof(buff), payment->close) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, buff, pageIdx, pageCount);
Expand Down Expand Up @@ -354,23 +354,23 @@ static parser_error_t parser_printTxAssetXfer(const txn_asset_xfer *asset_xfer,

case IDX_XFER_SOURCE:
snprintf(outKey, outKeyLen, "Asset src");
if (!encodePubKey((uint8_t*) tmpBuff.buff, sizeof(tmpBuff.buff), asset_xfer->sender)) {
if (encodePubKey((uint8_t*) tmpBuff.buff, sizeof(tmpBuff.buff), asset_xfer->sender) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, tmpBuff.buff, pageIdx, pageCount);
return parser_ok;

case IDX_XFER_DESTINATION:
snprintf(outKey, outKeyLen, "Asset dst");
if (!encodePubKey((uint8_t*) tmpBuff.buff, sizeof(tmpBuff.buff), asset_xfer->receiver)) {
if (encodePubKey((uint8_t*) tmpBuff.buff, sizeof(tmpBuff.buff), asset_xfer->receiver) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, tmpBuff.buff, pageIdx, pageCount);
return parser_ok;

case IDX_XFER_CLOSE:
snprintf(outKey, outKeyLen, "Asset close");
if (!encodePubKey((uint8_t*) tmpBuff.buff, sizeof(tmpBuff.buff), asset_xfer->close)) {
if (encodePubKey((uint8_t*) tmpBuff.buff, sizeof(tmpBuff.buff), asset_xfer->close) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, tmpBuff.buff, pageIdx, pageCount);
Expand Down Expand Up @@ -401,7 +401,7 @@ static parser_error_t parser_printTxAssetFreeze(const txn_asset_freeze *asset_fr

case IDX_FREEZE_ACCOUNT:
snprintf(outKey, outKeyLen, "Asset account");
if (!encodePubKey((uint8_t*) buff, sizeof(buff), asset_freeze->account)) {
if (encodePubKey((uint8_t*) buff, sizeof(buff), asset_freeze->account) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, buff, pageIdx, pageCount);
Expand Down Expand Up @@ -603,7 +603,7 @@ static parser_error_t parser_printTxApplication(parser_context_t *ctx,
uint8_t account[ACCT_SIZE] = {0};
snprintf(outKey, outKeyLen, "Account %d", tmpIdx);
CHECK_ERROR(_getAccount(ctx, account, tmpIdx, application->num_accounts))
if (!encodePubKey((uint8_t*) buff, sizeof(buff), account)) {
if (encodePubKey((uint8_t*) buff, sizeof(buff), account) == 0) {
return parser_unexpected_buffer_end;
}
pageString(outVal, outValLen, buff, pageIdx, pageCount);
Expand Down
2 changes: 1 addition & 1 deletion tests_zemu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {
"clean": "ts-node tests/pullImageKillOld.ts",
"test": "yarn clean && jest"
"test": "yarn clean && jest --maxConcurrency 4"
},
"dependencies": {
"@zondax/ledger-algorand": "../js",
Expand Down
Binary file modified tests_zemu/snapshots/s-mainmenu/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_zemu/snapshots/s-mainmenu/00011.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_zemu/snapshots/sp-mainmenu/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_zemu/snapshots/sp-mainmenu/00011.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_zemu/snapshots/st-mainmenu/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_zemu/snapshots/x-mainmenu/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_zemu/snapshots/x-mainmenu/00011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 83bbcb2

Please sign in to comment.