Skip to content

Commit

Permalink
fix ibc transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
chcmedeiros committed Mar 7, 2025
1 parent 704ad4e commit f8b0b56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/src/parser_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ parser_error_t getNumItems(const parser_context_t *ctx, uint8_t *numItems) {
case IBC:
*numItems = (app_mode_expert() ? IBC_EXPERT_PARAMS : IBC_NORMAL_PARAMS);
if(ctx->tx_obj->transaction.isMasp) {
*numItems += 3 * ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.n_outputs; // print from outputs
*numItems += 3 * ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.n_spends; // print from spends
*numItems += 2 * ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.n_outputs + ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.no_symbol_outputs; // print from outputs
*numItems += 2 * ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.n_spends + ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.no_symbol_spends; // print from spends
}
*numItems += ctx->tx_obj->ibc.transfer.non_masp_sources_len*2 + ctx->tx_obj->ibc.transfer.non_masp_targets_len*2 + ctx->tx_obj->ibc.transfer.no_symbol_sources + ctx->tx_obj->ibc.transfer.no_symbol_targets;
*numItems += ctx->tx_obj->ibc.memo.len > 0 && app_mode_expert();
Expand Down
8 changes: 4 additions & 4 deletions app/src/parser_print_txn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,9 +1412,9 @@ static __attribute__((noinline)) parser_error_t printIBCTxn( const parser_contex

const uint8_t sourcesStart = 9;
const uint8_t spendsStart = sourcesStart + 2*ctx->tx_obj->ibc.transfer.non_masp_sources_len + ctx->tx_obj->ibc.transfer.no_symbol_sources;
const uint8_t targetsStart = spendsStart + 3*n_spends;
const uint8_t targetsStart = spendsStart + 2*n_spends + ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.no_symbol_spends;
const uint8_t outputsStart = targetsStart + 2*ctx->tx_obj->ibc.transfer.non_masp_targets_len + ctx->tx_obj->ibc.transfer.no_symbol_targets;
const uint8_t memoStart = outputsStart + 3*n_outs;
const uint8_t memoStart = outputsStart + 2*n_outs + ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.no_symbol_outputs;
const uint8_t expertStart = memoStart + (ctx->tx_obj->transaction.header.memoSection != NULL);
AddressAlt source_address = {0};
AddressAlt target_address = {0};
Expand Down Expand Up @@ -1775,9 +1775,9 @@ static __attribute__((noinline)) parser_error_t printNFTIBCTxn( const parser_con

const uint8_t sourcesStart = 10;
const uint8_t spendsStart = sourcesStart + 2*ctx->tx_obj->ibc.transfer.non_masp_sources_len + ctx->tx_obj->ibc.transfer.no_symbol_sources;
const uint8_t targetsStart = spendsStart + 3*n_spends;
const uint8_t targetsStart = spendsStart + 2*n_spends + + ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.no_symbol_spends;
const uint8_t outputsStart = targetsStart + 2*ctx->tx_obj->ibc.transfer.non_masp_targets_len + ctx->tx_obj->ibc.transfer.no_symbol_targets;
const uint8_t memoStart = outputsStart + 3*n_outs;
const uint8_t memoStart = outputsStart + 2*n_outs + ctx->tx_obj->transaction.sections.maspBuilder.builder.sapling_builder.no_symbol_outputs;
const uint8_t expertStart = memoStart + (ctx->tx_obj->transaction.header.memoSection != NULL);
AddressAlt source_address = {0};
AddressAlt target_address = {0};
Expand Down

0 comments on commit f8b0b56

Please sign in to comment.