Skip to content

WIP : Dev swap feature - #27

Merged
sportron-ledger merged 33 commits into
developfrom
dev-swap-feature
Sep 1, 2026
Merged

sportron-ledger merged 33 commits into
developfrom
dev-swap-feature

Conversation

@sportron-ledger

Copy link
Copy Markdown
Contributor

Checklist

  • App update process has been followed
  • Target branch is develop
  • Application version has been bumped

@codecov-commenter

codecov-commenter commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.16049% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.75%. Comparing base (9612ad1) to head (1b28367).

Files with missing lines Patch % Lines
src/helper/send_response.c 71.18% 16 Missing and 1 partial ⚠️
src/account/signature.c 71.42% 5 Missing and 3 partials ⚠️
src/crypto/poseidon.c 46.66% 8 Missing ⚠️
src/crypto/group.c 85.71% 1 Missing and 2 partials ⚠️
src/account/account.c 96.42% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #27      +/-   ##
===========================================
+ Coverage    68.69%   69.75%   +1.05%     
===========================================
  Files           43       44       +1     
  Lines         5194     5432     +238     
  Branches       838      856      +18     
===========================================
+ Hits          3568     3789     +221     
- Misses        1357     1367      +10     
- Partials       269      276       +7     
Flag Coverage Δ
unittests 69.75% <77.16%> (+1.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


/// Convert params->amount into uint64_t
u128_t raw_amount = {0};
if (!swap_str_to_u128((const char *) params->amount, params->amount_length, &raw_amount)) {
PRINTF("Validated ticker: %s, decimals: %d\n", swap_validated.ticker, swap_validated.decimals);

// Save amount
if (!swap_str_to_u128(
G_context.tx.transfer.token_info->ticker);

if (G_called_from_swap) {
review_transaction(swap_check_validity(&G_context.tx.transfer, total_fees));
Comment thread src/account/account.c
Comment on lines +35 to +37
/*#define HASH_INPUT_MAX_LENGTH (8)

static field_t hash_input[HASH_INPUT_MAX_LENGTH];
static char text_buffer[32];
static field_t hash_input[HASH_INPUT_MAX_LENGTH];*/
Comment thread src/account/account.c
{
_Static_assert(HASH_INPUT_MAX_LENGTH >= 4, "hash_input size won't fit");
int status = -1;
//_Static_assert(HASH_INPUT_MAX_LENGTH >= 4, "hash_input size won't fit");
Comment thread src/account/account.c
{
_Static_assert(HASH_INPUT_MAX_LENGTH >= 6, "hash_input size won't fit");
int status = -1;
//_Static_assert(HASH_INPUT_MAX_LENGTH >= 6, "hash_input size won't fit");
Comment thread src/account/account.c
static int graph_key_from_view_key(const scalar_t *view_key, field_t *graph_key)
{
_Static_assert(HASH_INPUT_MAX_LENGTH >= 7, "hash_input size won't fit");
//_Static_assert(HASH_INPUT_MAX_LENGTH >= 7, "hash_input size won't fit");
@sportron-ledger sportron-ledger mentioned this pull request Aug 6, 2026
3 tasks
bboilot-ledger
bboilot-ledger previously approved these changes Aug 28, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code coverage report

Code Coverage

Per-file coverage
Package Line Rate Branch Rate Health
src.account 86% 70%
src.crypto 94% 81%
src.db 100% 100%
src.format 98% 97%
src.helper 84% 58%
src.swap 100% 100%
src.transaction 92% 80%
Summary 91% (1848 / 2027) 78% (687 / 881)

Comment thread src/crypto/bhp.c
Comment on lines +147 to +166
/*bigint_256_t s;
group_t b;
uint8_t bn_x[32];
uint8_t bn_y[32];

(void) cx_ecpoint_export(&point_a, bn_x, 32, bn_y, 32);
bn_to_big_int(bn_x, &s);
field_from_big_int(&b.x, &s);
bn_to_big_int(bn_y, &s);
field_from_big_int(&b.y, &s);
group_println(&b);

(void) cx_ecpoint_export(sum, bn_x, 32, bn_y, 32);
bn_to_big_int(bn_x, &s);
field_from_big_int(&b.x, &s);
bn_to_big_int(bn_y, &s);
field_from_big_int(&b.y, &s);
group_println(&b);

PRINTF("\n");*/
Comment thread src/crypto/bhp.c
Comment on lines +204 to +206
// sum_add(&sum, &bhp_512_base_compressed[base_offset]);
// sum_add_2(&sum, &bhp_1024_base_bn[base_offset]);
// sum_add_3(&sum, &bhp_512_base[base_offset]);
Comment thread src/crypto/bhp.c
Comment on lines +468 to +470
/*bhp_1024_hash(buffer, offset, &function_id);
PRINTF("function_id : ");
field_println(&function_id);*/
Comment thread src/crypto/bhp.c
field_println(&function_id);*/

field_t hash;
// bhp_512_hash_optim(buf_test, 506, &hash);
Comment thread src/crypto/bhp.c
Comment on lines +595 to +608
/*(void) cx_ecpoint_init(&point, bn_x, 32, bn_y, 32);
(void) cx_ecpoint_compress(&point, compressed, 32, &sign);
PRINTF(" {.compressed = {");
for (int j = 0; j < 32; j++) {
if (j == 16) {
PRINTF("\n ");
}
PRINTF("0x%02x", compressed[j]);
if (j < 31) {
PRINTF(", ");
}
}
PRINTF("},\n");
PRINTF(" .sign = %d},\n", sign);*/
@sportron-ledger
sportron-ledger merged commit d062f6c into develop Sep 1, 2026
122 checks passed
@sportron-ledger
sportron-ledger deleted the dev-swap-feature branch September 1, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants