From da80886cedead75d9f6181c7fd6e7ec91a404f2c Mon Sep 17 00:00:00 2001 From: abenso Date: Fri, 24 Jan 2025 16:19:53 -0300 Subject: [PATCH] test to find error --- app/src/plan/action_dutch_auction_end.c | 4 +++- app/src/plan/action_dutch_auction_schedule.c | 4 +++- app/src/plan/action_dutch_auction_withdraw.c | 4 +++- app/src/plan/delegate.c | 4 +++- app/src/plan/delegator_vote.c | 4 +++- app/src/plan/ics20_withdrawal.c | 4 +++- app/src/plan/output.c | 4 +++- app/src/plan/position_close.c | 4 +++- app/src/plan/position_open.c | 4 +++- app/src/plan/position_withdraw.c | 4 +++- app/src/plan/spend.c | 6 ++++-- app/src/plan/swap.c | 4 +++- app/src/plan/undelegate.c | 4 +++- app/src/plan/undelegate_claim.c | 4 +++- 14 files changed, 43 insertions(+), 15 deletions(-) diff --git a/app/src/plan/action_dutch_auction_end.c b/app/src/plan/action_dutch_auction_end.c index c3ecbb7..06e9eb8 100644 --- a/app/src/plan/action_dutch_auction_end.c +++ b/app/src/plan/action_dutch_auction_end.c @@ -59,7 +59,9 @@ parser_error_t action_dutch_auction_end_getItem(const parser_context_t *ctx, char bufferUI[DUTCH_AUCTION_END_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(action_dutch_auction_end_printValue(ctx, action_dutch_auction_end, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/action_dutch_auction_schedule.c b/app/src/plan/action_dutch_auction_schedule.c index c20ca21..bf45be9 100644 --- a/app/src/plan/action_dutch_auction_schedule.c +++ b/app/src/plan/action_dutch_auction_schedule.c @@ -99,7 +99,9 @@ parser_error_t action_dutch_auction_schedule_getItem( char bufferUI[DUTCH_AUCTION_SCHEDULE_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(action_dutch_auction_schedule_printValue(ctx, action_dutch_auction_schedule, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/action_dutch_auction_withdraw.c b/app/src/plan/action_dutch_auction_withdraw.c index 97f8633..bc912f6 100644 --- a/app/src/plan/action_dutch_auction_withdraw.c +++ b/app/src/plan/action_dutch_auction_withdraw.c @@ -91,7 +91,9 @@ parser_error_t action_dutch_auction_withdraw_getItem( char bufferUI[DUTCH_AUCTION_WITHDRAW_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(action_dutch_auction_withdraw_printValue(ctx, action_dutch_auction_withdraw, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/delegate.c b/app/src/plan/delegate.c index 82b78fe..abb97c9 100644 --- a/app/src/plan/delegate.c +++ b/app/src/plan/delegate.c @@ -62,7 +62,9 @@ parser_error_t delegate_getItem(const parser_context_t *ctx, const delegate_plan char bufferUI[DELEGATE_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(delegate_printValue(ctx, delegate, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/delegator_vote.c b/app/src/plan/delegator_vote.c index 94cb862..c954781 100644 --- a/app/src/plan/delegator_vote.c +++ b/app/src/plan/delegator_vote.c @@ -113,7 +113,9 @@ parser_error_t delegator_vote_getItem(const parser_context_t *ctx, const delegat char bufferUI[DELEGATE_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(delegator_vote_printValue(ctx, delegator_vote, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/ics20_withdrawal.c b/app/src/plan/ics20_withdrawal.c index cc1c31a..12161ce 100644 --- a/app/src/plan/ics20_withdrawal.c +++ b/app/src/plan/ics20_withdrawal.c @@ -65,7 +65,9 @@ parser_error_t ics20_withdrawal_getItem(const parser_context_t *ctx, const ics20 char bufferUI[ICS20_WITHDRAWAL_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(ics20_withdrawal_printValue(ctx, ics20_withdrawal, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/output.c b/app/src/plan/output.c index 49d8cc9..4a1819c 100644 --- a/app/src/plan/output.c +++ b/app/src/plan/output.c @@ -73,7 +73,9 @@ parser_error_t output_getItem(const parser_context_t *ctx, const output_plan_t * char bufferUI[OUTPUT_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(output_printValue(ctx, output, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/position_close.c b/app/src/plan/position_close.c index 84d5b62..f3d7965 100644 --- a/app/src/plan/position_close.c +++ b/app/src/plan/position_close.c @@ -57,7 +57,9 @@ parser_error_t position_close_getItem(const parser_context_t *ctx, const positio char bufferUI[POSITION_CLOSE_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(position_close_printValue(ctx, position_close, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/position_open.c b/app/src/plan/position_open.c index 2767972..40d9afd 100644 --- a/app/src/plan/position_open.c +++ b/app/src/plan/position_open.c @@ -98,7 +98,9 @@ parser_error_t position_open_getItem(const parser_context_t *ctx, const position char bufferUI[POSITION_OPEN_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(position_open_printValue(ctx, position_open, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/position_withdraw.c b/app/src/plan/position_withdraw.c index fbd79d2..01ec694 100644 --- a/app/src/plan/position_withdraw.c +++ b/app/src/plan/position_withdraw.c @@ -106,7 +106,9 @@ parser_error_t position_withdraw_getItem(const parser_context_t *ctx, const posi char bufferUI[POSITION_WITHDRAW_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(position_withdraw_printValue(ctx, position_withdraw, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/spend.c b/app/src/plan/spend.c index 1d1124a..1cd21ad 100644 --- a/app/src/plan/spend.c +++ b/app/src/plan/spend.c @@ -77,7 +77,7 @@ parser_error_t spend_printValue(const parser_context_t *ctx, const spend_plan_t // example: Spend 100 USDC to penumbra1k0zzug62gpz60sejdvu9q7mq… // add action title - snprintf(outVal, outValLen, "%s", "Spend "); + snprintf(outVal, outValLen, "Spend "); uint16_t written_value = strlen(outVal); // add value @@ -115,7 +115,9 @@ parser_error_t spend_getItem(const parser_context_t *ctx, const spend_plan_t *sp char bufferUI[SPEND_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(spend_printValue(ctx, spend, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/swap.c b/app/src/plan/swap.c index 1847a00..4a8eaae 100644 --- a/app/src/plan/swap.c +++ b/app/src/plan/swap.c @@ -108,7 +108,9 @@ parser_error_t swap_getItem(const parser_context_t *ctx, const swap_plan_t *swap char bufferUI[SWAP_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(swap_printValue(ctx, swap, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/undelegate.c b/app/src/plan/undelegate.c index 8b70ade..85085c7 100644 --- a/app/src/plan/undelegate.c +++ b/app/src/plan/undelegate.c @@ -69,7 +69,9 @@ parser_error_t undelegate_getItem(const parser_context_t *ctx, const undelegate_ char bufferUI[UNDELEGATE_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(undelegate_printValue(ctx, undelegate, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount); diff --git a/app/src/plan/undelegate_claim.c b/app/src/plan/undelegate_claim.c index 187cc49..5db56b7 100644 --- a/app/src/plan/undelegate_claim.c +++ b/app/src/plan/undelegate_claim.c @@ -67,7 +67,9 @@ parser_error_t undelegate_claim_getItem(const parser_context_t *ctx, const undel char bufferUI[UNDELEGATE_DISPLAY_MAX_LEN] = {0}; - snprintf(outKey, outKeyLen, "Action_%d", actionIdx); + snprintf(outKey, outKeyLen, "Action_"); + uint16_t written_value_key = strlen(outKey); + snprintf(outKey + written_value_key, outKeyLen - written_value_key, "%d", actionIdx); CHECK_ERROR(undelegate_claim_printValue(ctx, undelegate, bufferUI, sizeof(bufferUI))); pageString(outVal, outValLen, bufferUI, pageIdx, pageCount);