Skip to content

Commit 74c35b3

Browse files
committed
read root type
1 parent 59142c5 commit 74c35b3

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

app/src/metadata_reader.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,5 +610,15 @@ parser_error_t metadata_read(parser_context_t *ctx, parser_tx_t *txObj) {
610610
}
611611
}
612612

613+
//read root_type_indices
614+
CHECK_ERROR(read_u32(ctx, &txObj->schema.root_type_indices.qty));
615+
printf("root_type_indices.qty: %d\n", txObj->schema.root_type_indices.qty);
616+
for (uint32_t i = 0; i < txObj->schema.root_type_indices.qty; i++) {
617+
CHECK_ERROR(read_u64(ctx, &txObj->schema.root_type_indices.indices[i]));
618+
printf("root_type_indices[%d]: %llu\n", i, txObj->schema.root_type_indices.indices[i]);
619+
}
620+
621+
622+
613623
return parser_ok;
614624
}

app/src/parser_txdef.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
#include <stdint.h>
2424
#include <stdbool.h>
2525

26-
#define MAX_FIELDS_QTY 10
26+
#define MAX_FIELDS_QTY 20
2727
#define MAX_VARIANTS_QTY 20
2828
#define MAX_HRP_LEN 83
2929
#define MAX_SCHEMES_QTY 200
@@ -268,10 +268,15 @@ typedef struct {
268268
linking_scheme_t schemes[MAX_SCHEMES_QTY];
269269
} types_t;
270270

271+
typedef struct {
272+
uint32_t qty;
273+
uint64_t indices[MAX_SCHEMES_QTY];
274+
} root_type_indices_t;
275+
271276
// Schema structure
272277
typedef struct {
273278
types_t types;
274-
bytes_t root_type_indices;
279+
root_type_indices_t root_type_indices;
275280
bytes_t chain_data;
276281
bytes_t extra_metadata_hash;
277282
bytes_t chain_hash;

0 commit comments

Comments
 (0)