This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
types.h
123 lines (103 loc) · 2.15 KB
/
types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
* @file
* @copyright defined in eos/LICENSE.txt
*/
#pragma once
#include <stdint.h>
#include <wchar.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup types Builtin Types
* @ingroup contractdev
* @brief Specifies builtin types, typedefs and aliases
*
* @{
*/
/**
* @brief Name of an account
* @details Name of an account
*/
typedef uint64_t account_name;
/**
* @brief Name of a permission
* @details Name of an account
*/
typedef uint64_t permission_name;
/**
* @brief Name of a table
* @details Name of atable
*/
typedef uint64_t table_name;
/**
* @brief Time
* @details Time
*/
typedef uint32_t time;
/**
* @brief Name of a scope
* @details Name of a scope
*/
typedef uint64_t scope_name;
/**
* @brief Name of an action
* @details Name of an action
*/
typedef uint64_t action_name;
/**
* @brief Macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned
* @details Macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned
*/
typedef uint16_t weight_type;
/* macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned */
#define ALIGNED(X) __attribute__ ((aligned (16))) X
/**
* @brief EOSIO Public Key
* @details EOSIO Public Key. It is 34 bytes.
*/
struct public_key {
char data[34];
};
/**
* @brief EOSIO Signature
* @details EOSIO Signature. It is 66 bytes.
*/
struct signature {
uint8_t data[66];
};
/**
* @brief 256-bit hash
* @details 256-bit hash
*/
struct ALIGNED(checksum256) {
uint8_t hash[32];
};
/**
* @brief 160-bit hash
* @details 160-bit hash
*/
struct ALIGNED(checksum160) {
uint8_t hash[20];
};
/**
* @brief 512-bit hash
* @details 512-bit hash
*/
struct ALIGNED(checksum512) {
uint8_t hash[64];
};
/**
* @brief Type of EOSIO Transaction Id
* @details Type of EOSIO Transaction Id. It is 256-bit hash
*/
typedef struct checksum256 transaction_id_type;
typedef struct checksum256 block_id_type;
struct account_permission {
account_name account;
permission_name permission;
};
#ifdef __cplusplus
} /// extern "C"
#endif
/// @}