@@ -351,28 +351,25 @@ parser_error_t schema_display_tuple(parser_tx_t *txObj) {
351351 CHECK_ERROR (read_tuple (& txObj -> merkle_proofs .leaves .data , & tuple_type ));
352352 CHECK_ERROR (schema_reset_leaf_offset (& txObj -> merkle_proofs .leaves ));
353353
354- uint32_t field_index [MAX_FIELDS_QTY ] = {0 };
355- uint16_t index_qty = 0 ;
356- uint32_t max_indexes = MAX_FIELDS_QTY ;
357- CHECK_ERROR (get_unnamed_link_index (tuple_type .fields , tuple_type .fields_qty , field_index , & index_qty , max_indexes ));
358-
359- for (uint32_t i = 0 ; i < index_qty ; i ++ ) {
360- uint8_t type = 0 ;
361- CHECK_ERROR (get_schema_type (txObj , field_index [i ], & type ));
362- print_u8 ("Type: " , type );
363- if (type == LINKING_SCHEME_INTEGER ) {
364- // TODO: Implement me
365- print_string ("schema_display_tuple IMPLEMENT ME 0" );
366- return parser_unexpected_type ;
367- }
368- }
354+ // for (uint32_t i = 0; i < index_qty; i++) {
355+ // uint8_t type = 0;
356+ // CHECK_ERROR(get_schema_type(txObj, field_index[i], &type));
357+ // print_u8("Type: ", type);
358+ // if (type == LINKING_SCHEME_INTEGER) {
359+ // // TODO: Implement me
360+ // print_string("schema_display_tuple IMPLEMENT ME 0");
361+ // return parser_unexpected_type;
362+ // }
363+ // }
369364
365+ unnamed_field_t unnamed_field = {0 };
370366 if (tuple_type .has_show_as || tuple_type .has_structured_show_as ) {
371367 for (uint32_t i = 0 ; i < tuple_type .fields_qty ; i ++ ) {
372- // TODO: check context_bytes and container_context
373- switch (tuple_type .fields [i ].value .tag ) {
368+ MEMZERO (& unnamed_field , sizeof (unnamed_field_t ));
369+ CHECK_ERROR (read_unnamed_field (& tuple_type .unnamed_fields , & unnamed_field ));
370+ switch (unnamed_field .value .tag ) {
374371 case LINK_BY_INDEX :
375- CHECK_ERROR (schema_display_generic_by_index (txObj , tuple_type . fields [ i ] .value .data .by_index ));
372+ CHECK_ERROR (schema_display_generic_by_index (txObj , unnamed_field .value .data .by_index ));
376373 break ;
377374 default :
378375 print_string ("Tuple field is not a link by index\n" );
@@ -381,13 +378,14 @@ parser_error_t schema_display_tuple(parser_tx_t *txObj) {
381378 }
382379 } else {
383380 for (uint32_t i = 0 ; i < tuple_type .fields_qty ; i ++ ) {
384- // TODO: check context_bytes and container_context
385- switch (tuple_type .fields [i ].value .tag ) {
381+ MEMZERO (& unnamed_field , sizeof (unnamed_field_t ));
382+ CHECK_ERROR (read_unnamed_field (& tuple_type .unnamed_fields , & unnamed_field ));
383+ switch (unnamed_field .value .tag ) {
386384 case LINK_BY_INDEX :
387- CHECK_ERROR (schema_display_generic_by_index (txObj , tuple_type . fields [ i ] .value .data .by_index ));
385+ CHECK_ERROR (schema_display_generic_by_index (txObj , unnamed_field .value .data .by_index ));
388386 break ;
389387 case LINK_IMMEDIATE :
390- CHECK_ERROR (schema_display_by_primitive (txObj , & tuple_type . fields [ i ] .value .data .immediate ));
388+ CHECK_ERROR (schema_display_by_primitive (txObj , & unnamed_field .value .data .immediate ));
391389 break ;
392390 default :
393391 print_string ("Tuple field is not a link by index\n" );
@@ -397,7 +395,7 @@ parser_error_t schema_display_tuple(parser_tx_t *txObj) {
397395 return parser_ok ;
398396 }
399397
400- if (!tuple_type . fields [ i ] .is_expert || ui_expert_mode ) {
398+ if (!unnamed_field .is_expert || ui_expert_mode ) {
401399 char index_str [12 ] = {0 };
402400 snprintf (index_str , sizeof (index_str ), "%u" , i );
403401 CHECK_ERROR (append_item_title (index_str , strlen (index_str )));
0 commit comments