Skip to content

Commit 4eb2768

Browse files
committed
fix address parser
1 parent 0553a30 commit 4eb2768

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

app/src/modules/common_reader.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ parser_error_t read_address(parser_context_t *ctx, address_t *address) {
4848
CHECK_INPUT(ctx);
4949
CHECK_INPUT(address);
5050

51-
// TODO: check this value, MultiAddress enum?
52-
uint8_t unknown = 0;
53-
CHECK_ERROR(read_u8(ctx, &unknown));
54-
print_u8("unknown", unknown);
51+
CHECK_ERROR(read_u8(ctx, &address->type));
52+
print_u8("address type", address->type);
5553

5654
address->address.len = ADDRESS_SIZE;
5755
address->address.ptr = ctx->buffer.ptr + ctx->offset;

app/src/txdefs/common_txdef.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ typedef enum {
4444
RUNTIME_CALL_ACCESS_PATTERN,
4545
} runtime_call_type_t;
4646

47+
typedef enum {
48+
ADDRESS_TYPE_STANDARD,
49+
ADDRESS_TYPE_VM,
50+
} address_type_t;
51+
4752
typedef struct {
4853
const uint8_t *ptr;
4954
uint16_t len;
@@ -77,6 +82,7 @@ typedef struct {
7782
} gas_u128_t;
7883

7984
typedef struct {
85+
address_type_t type;
8086
bytes_t address;
8187
} address_t;
8288

0 commit comments

Comments
 (0)