1
1
/* *
2
2
* @file
3
- * @copyright defined in yosemite /LICENSE.txt
3
+ * @copyright defined in infrablockchain /LICENSE.txt
4
4
*/
5
5
#pragma once
6
6
7
7
#include < eosiolib/eosio.hpp>
8
8
#include < eosiolib/asset.hpp>
9
9
#include < infrablockchainlib/system_accounts.hpp>
10
10
11
- #define YOSEMITE_ID_ACC_TYPE_NORMAL 0b0000000000000000
12
- #define YOSEMITE_ID_ACC_TYPE_SYSTEM 0b1000000000000000
11
+ #define INFRABLOCKCHAIN_ID_ACC_TYPE_NORMAL 0b0000000000000000
12
+ #define INFRABLOCKCHAIN_ID_ACC_TYPE_SYSTEM 0b1000000000000000
13
13
14
- #define YOSEMITE_ID_KYC_NO_AUTH 0b0000000000000000
15
- #define YOSEMITE_ID_KYC_EMAIL_AUTH 0b0000000000000001
16
- #define YOSEMITE_ID_KYC_PHONE_AUTH 0b0000000000000010
17
- #define YOSEMITE_ID_KYC_REAL_NAME_AUTH 0b0000000000000100
18
- #define YOSEMITE_ID_KYC_BANK_ACCOUNT_AUTH 0b0000000000001000
19
- #define YOSEMITE_ID_KYC_MAX_AUTH 0b0000000000001111
14
+ #define INFRABLOCKCHAIN_ID_KYC_NO_AUTH 0b0000000000000000
15
+ #define INFRABLOCKCHAIN_ID_KYC_EMAIL_AUTH 0b0000000000000001
16
+ #define INFRABLOCKCHAIN_ID_KYC_PHONE_AUTH 0b0000000000000010
17
+ #define INFRABLOCKCHAIN_ID_KYC_REAL_NAME_AUTH 0b0000000000000100
18
+ #define INFRABLOCKCHAIN_ID_KYC_BANK_ACCOUNT_AUTH 0b0000000000001000
19
+ #define INFRABLOCKCHAIN_ID_KYC_MAX_AUTH 0b0000000000001111
20
20
21
- #define YOSEMITE_ID_ACC_STATE_CLEAR 0x00000000
22
- #define YOSEMITE_ID_ACC_STATE_BLACKLISTED 0x00000001
23
- #define YOSEMITE_ID_ACC_STATE_BLACKLISTED_NTOKEN_SEND 0x00000002
24
- #define YOSEMITE_ID_ACC_STATE_BLACKLISTED_NTOKEN_RECEIVE 0x00000004
25
- #define YOSEMITE_ID_ACC_STATE_MAX 0x00000007
21
+ #define INFRABLOCKCHAIN_ID_ACC_STATE_CLEAR 0x00000000
22
+ #define INFRABLOCKCHAIN_ID_ACC_STATE_BLACKLISTED 0x00000001
23
+ #define INFRABLOCKCHAIN_ID_ACC_STATE_BLACKLISTED_NTOKEN_SEND 0x00000002
24
+ #define INFRABLOCKCHAIN_ID_ACC_STATE_BLACKLISTED_NTOKEN_RECEIVE 0x00000004
25
+ #define INFRABLOCKCHAIN_ID_ACC_STATE_MAX 0x00000007
26
26
27
- namespace yosemite { namespace identity {
27
+ namespace infrablockchain { namespace identity {
28
28
29
29
using identity_type_t = uint16_t ;
30
30
using identity_kyc_t = uint16_t ;
@@ -50,15 +50,15 @@ namespace yosemite { namespace identity {
50
50
if (is_system_account (account)) {
51
51
return identity_info{
52
52
account, 0 ,
53
- YOSEMITE_ID_ACC_TYPE_SYSTEM, YOSEMITE_ID_KYC_MAX_AUTH, YOSEMITE_ID_ACC_STATE_CLEAR , {}
53
+ INFRABLOCKCHAIN_ID_ACC_TYPE_SYSTEM, INFRABLOCKCHAIN_ID_KYC_MAX_AUTH, INFRABLOCKCHAIN_ID_ACC_STATE_CLEAR , {}
54
54
};
55
55
}
56
- identity_idx identity_table (YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT );
56
+ identity_idx identity_table (INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT );
57
57
auto id_it = identity_table.find (account);
58
58
if (id_it == identity_table.end ()) {
59
59
return identity_info{
60
60
account, 0 ,
61
- YOSEMITE_ID_ACC_TYPE_NORMAL, YOSEMITE_ID_KYC_NO_AUTH, YOSEMITE_ID_ACC_STATE_CLEAR , {}
61
+ INFRABLOCKCHAIN_ID_ACC_TYPE_NORMAL, INFRABLOCKCHAIN_ID_KYC_NO_AUTH, INFRABLOCKCHAIN_ID_ACC_STATE_CLEAR , {}
62
62
};
63
63
} else {
64
64
return *id_it;
@@ -67,19 +67,19 @@ namespace yosemite { namespace identity {
67
67
68
68
identity_type_t get_identity_account_type (const account_name account) {
69
69
if (is_system_account (account)) {
70
- return YOSEMITE_ID_ACC_TYPE_SYSTEM ;
70
+ return INFRABLOCKCHAIN_ID_ACC_TYPE_SYSTEM ;
71
71
}
72
- identity_idx identity_table (YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT );
72
+ identity_idx identity_table (INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT );
73
73
auto id_it = identity_table.find (account);
74
74
if (id_it == identity_table.end ()) {
75
- return YOSEMITE_ID_ACC_TYPE_NORMAL ;
75
+ return INFRABLOCKCHAIN_ID_ACC_TYPE_NORMAL ;
76
76
} else {
77
77
return id_it->type ;
78
78
}
79
79
}
80
80
81
81
bool is_valid_account_type (uint16_t type) {
82
- return type == YOSEMITE_ID_ACC_TYPE_NORMAL || type == YOSEMITE_ID_ACC_TYPE_SYSTEM ;
82
+ return type == INFRABLOCKCHAIN_ID_ACC_TYPE_NORMAL || type == INFRABLOCKCHAIN_ID_ACC_TYPE_SYSTEM ;
83
83
}
84
84
85
85
bool is_account_type (const account_name account, identity_type_t type_code) {
@@ -88,19 +88,19 @@ namespace yosemite { namespace identity {
88
88
89
89
identity_kyc_t get_identity_kyc_status (const account_name account) {
90
90
if (is_system_account (account)) {
91
- return YOSEMITE_ID_KYC_MAX_AUTH ;
91
+ return INFRABLOCKCHAIN_ID_KYC_MAX_AUTH ;
92
92
}
93
- identity_idx identity_table (YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT );
93
+ identity_idx identity_table (INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT );
94
94
auto id_it = identity_table.find (account);
95
95
if (id_it == identity_table.end ()) {
96
- return YOSEMITE_ID_KYC_NO_AUTH ;
96
+ return INFRABLOCKCHAIN_ID_KYC_NO_AUTH ;
97
97
} else {
98
98
return id_it->kyc ;
99
99
}
100
100
}
101
101
102
102
bool is_valid_kyc_status (uint16_t kyc_flags) {
103
- return kyc_flags <= YOSEMITE_ID_KYC_MAX_AUTH ;
103
+ return kyc_flags <= INFRABLOCKCHAIN_ID_KYC_MAX_AUTH ;
104
104
}
105
105
106
106
bool has_kyc_status (const account_name account, identity_kyc_t kyc_flags) {
@@ -114,19 +114,19 @@ namespace yosemite { namespace identity {
114
114
115
115
identity_state_t get_identity_account_state (const account_name account) {
116
116
if (is_system_account (account)) {
117
- return YOSEMITE_ID_ACC_STATE_CLEAR ;
117
+ return INFRABLOCKCHAIN_ID_ACC_STATE_CLEAR ;
118
118
}
119
- identity_idx identity_table (YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT );
119
+ identity_idx identity_table (INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT );
120
120
auto id_it = identity_table.find (account);
121
121
if (id_it == identity_table.end ()) {
122
- return YOSEMITE_ID_ACC_STATE_CLEAR ;
122
+ return INFRABLOCKCHAIN_ID_ACC_STATE_CLEAR ;
123
123
} else {
124
124
return id_it->state ;
125
125
}
126
126
}
127
127
128
128
bool is_valid_account_state (uint32_t state_flags) {
129
- return state_flags <= YOSEMITE_ID_ACC_STATE_MAX ;
129
+ return state_flags <= INFRABLOCKCHAIN_ID_ACC_STATE_MAX ;
130
130
}
131
131
132
132
bool has_account_state (const account_name account, identity_state_t state_flag) {
@@ -142,7 +142,7 @@ namespace yosemite { namespace identity {
142
142
if (is_system_account (account)) {
143
143
return std::string ();
144
144
}
145
- identity_idx identity_table (YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT );
145
+ identity_idx identity_table (INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT );
146
146
auto id_it = identity_table.find (account);
147
147
if (id_it == identity_table.end ()) {
148
148
return std::string ();
0 commit comments