|
11 | 11 |
|
12 | 12 | #define GET_PRINTABLE_AMOUNT 4 |
13 | 13 |
|
| 14 | +#define MAX_PRINTABLE_AMOUNT_SIZE 50 |
| 15 | + |
14 | 16 | // structure that should be send to specific coin application to get address |
15 | 17 | typedef struct check_address_parameters_s { |
16 | 18 | // IN |
17 | | - unsigned char* coin_configuration; |
18 | | - unsigned char coin_configuration_length; |
| 19 | + const unsigned char* const coin_configuration; |
| 20 | + const unsigned char coin_configuration_length; |
19 | 21 | // serialized path, segwit, version prefix, hash used, dictionary etc. |
20 | 22 | // fields and serialization format depends on spesific coin app |
21 | | - unsigned char* address_parameters; |
22 | | - unsigned char address_parameters_length; |
23 | | - char* address_to_check; |
24 | | - char* extra_id_to_check; |
| 23 | + const unsigned char* const address_parameters; |
| 24 | + const unsigned char address_parameters_length; |
| 25 | + const char* const address_to_check; |
| 26 | + const char* const extra_id_to_check; |
25 | 27 | // OUT |
26 | 28 | int result; |
27 | 29 | } check_address_parameters_t; |
28 | 30 |
|
29 | 31 | // structure that should be send to specific coin application to get printable amount |
30 | 32 | typedef struct get_printable_amount_parameters_s { |
31 | 33 | // IN |
32 | | - unsigned char* coin_configuration; |
33 | | - unsigned char coin_configuration_length; |
34 | | - unsigned char* amount; |
35 | | - unsigned char amount_length; |
36 | | - bool is_fee; |
| 34 | + const unsigned char* const coin_configuration; |
| 35 | + const unsigned char coin_configuration_length; |
| 36 | + const unsigned char* const amount; |
| 37 | + const unsigned char amount_length; |
| 38 | + const bool is_fee; |
37 | 39 | // OUT |
38 | | - char printable_amount[30]; |
| 40 | + char printable_amount[MAX_PRINTABLE_AMOUNT_SIZE]; |
39 | 41 | // int result; |
40 | 42 | } get_printable_amount_parameters_t; |
41 | 43 |
|
42 | 44 | typedef struct create_transaction_parameters_s { |
43 | | - unsigned char* coin_configuration; |
44 | | - unsigned char coin_configuration_length; |
45 | | - unsigned char* amount; |
46 | | - unsigned char amount_length; |
47 | | - unsigned char* fee_amount; |
48 | | - unsigned char fee_amount_length; |
49 | | - char* destination_address; |
50 | | - char* destination_address_extra_id; |
| 45 | + const unsigned char* const coin_configuration; |
| 46 | + const unsigned char coin_configuration_length; |
| 47 | + const unsigned char* const amount; |
| 48 | + const unsigned char amount_length; |
| 49 | + const unsigned char* const fee_amount; |
| 50 | + const unsigned char fee_amount_length; |
| 51 | + const char* const destination_address; |
| 52 | + const char* const destination_address_extra_id; |
51 | 53 | } create_transaction_parameters_t; |
52 | 54 |
|
53 | 55 | #endif // _SWAP_LIB_CALLS_H_ |
0 commit comments