Skip to content

Commit ea19c8b

Browse files
committed
renaming yosemite => infrablockchain in chain core code and contract lib, renaming yosemite => infra-node, renaming yosemite => infrasys
1 parent df173ba commit ea19c8b

File tree

160 files changed

+1933
-1925
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+1933
-1925
lines changed

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ else()
4646
endif()
4747

4848
set( CLI_CLIENT_EXECUTABLE_NAME infra-cli )
49-
set( NODE_EXECUTABLE_NAME yosemite )
49+
set( NODE_EXECUTABLE_NAME infra-node )
5050
set( KEY_STORE_EXECUTABLE_NAME infra-keystore )
5151
set( LAUNCHER_EXECUTABLE_NAME yoslauncher )
5252
set( ABI_GENERATOR_EXECUTABLE_NAME yosabigen )
@@ -228,21 +228,21 @@ endif()
228228
message( STATUS "Using '${CORE_SYMBOL_NAME}' as CORE symbol name" )
229229

230230

231-
if ("${YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME}" STREQUAL "")
232-
set(YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME "DUSD")
231+
if ("${INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME}" STREQUAL "")
232+
set(INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME "DUSD")
233233
endif()
234-
string(TOUPPER ${YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME} YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME)
234+
string(TOUPPER ${INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME} INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME)
235235

236-
string(LENGTH ${YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME} YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME_LENGTH)
237-
if (YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME_LENGTH GREATER 7)
238-
message(FATAL_ERROR "YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME length must be between 1 and 7 characters")
236+
string(LENGTH ${INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME} INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME_LENGTH)
237+
if (INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME_LENGTH GREATER 7)
238+
message(FATAL_ERROR "INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME length must be between 1 and 7 characters")
239239
endif()
240240

241-
if ("${YOSEMITE_NATIVE_TOKEN_PRECISION}" STREQUAL "")
242-
set(YOSEMITE_NATIVE_TOKEN_PRECISION "4")
241+
if ("${INFRABLOCKCHAIN_NATIVE_TOKEN_PRECISION}" STREQUAL "")
242+
set(INFRABLOCKCHAIN_NATIVE_TOKEN_PRECISION "4")
243243
endif()
244244

245-
message( STATUS "Using S(${YOSEMITE_NATIVE_TOKEN_PRECISION},${YOSEMITE_NATIVE_TOKEN_SYMBOL_NAME}) as YOSEMITE Native Token Symbol" )
245+
message( STATUS "Using S(${INFRABLOCKCHAIN_NATIVE_TOKEN_PRECISION},${INFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME}) as YOSEMITE Native Token Symbol" )
246246

247247

248248
if ("${EOSIO_ROOT_KEY}" STREQUAL "")

Docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN git clone -b $branch https://github.com/YosemiteLabs/yosemite-public-blockch
77
&& cd yosemite-public-blockchain && echo "$branch:$(git rev-parse HEAD)" > /etc/yosemite-version \
88
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
99
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DBUILD_MONGO_DB_PLUGIN=true \
10-
-DYOSEMITE_NATIVE_TOKEN_SYMBOL_NAME=$native_token_symbol -DYOSEMITE_NATIVE_TOKEN_PRECISION=$native_token_precision \
10+
-DINFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME=$native_token_symbol -DINFRABLOCKCHAIN_NATIVE_TOKEN_PRECISION=$native_token_precision \
1111
&& cmake --build /tmp/build --target install
1212

1313
FROM ubuntu:18.04

Docker/dev/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN git clone -b $branch https://github.com/YosemiteLabs/yosemite-public-blockch
77
&& cd yosemite-public-blockchain && echo "$branch:$(git rev-parse HEAD)" > /etc/yosemite-version \
88
&& cmake -H. -B"/opt/yosemite" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
99
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/yosemite -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \
10-
-DYOSEMITE_NATIVE_TOKEN_SYMBOL_NAME=$native_token_symbol -DYOSEMITE_NATIVE_TOKEN_PRECISION=$native_token_precision \
10+
-DINFRABLOCKCHAIN_NATIVE_TOKEN_SYMBOL_NAME=$native_token_symbol -DINFRABLOCKCHAIN_NATIVE_TOKEN_PRECISION=$native_token_precision \
1111
&& cmake --build /opt/yosemite --target install \
1212
&& cp /yosemite-public-blockchain/Docker/config.ini / && ln -s /opt/yosemite/contracts /contracts \
1313
&& cp /yosemite-public-blockchain/Docker/yosemited.sh /opt/yosemite/bin/yosemited.sh

contracts/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ add_subdirectory(integration_test)
3333
add_subdirectory(eosio.msig)
3434
add_subdirectory(eosio.sudo)
3535
add_subdirectory(infrablockchainlib)
36-
add_subdirectory(yx.system)
37-
add_subdirectory(yx.tokenabi)
38-
add_subdirectory(yx.txfee)
39-
add_subdirectory(yx.identity)
36+
add_subdirectory(infrasys)
37+
add_subdirectory(sys.tokenabi)
38+
add_subdirectory(sys.txfee)
39+
add_subdirectory(sys.identity)
4040
add_subdirectory(yosemitex.fiat.stable.token)
4141
add_subdirectory(yosemitex.credit.token)
4242
add_subdirectory(yosemite.card.ytoken)

contracts/eosiolib/dispatcher.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ extern "C" { \
123123
auto self = receiver; \
124124
if( action == N(onerror)) { \
125125
/* onerror is only valid if it is for the "eosio" code account and authorized by "eosio"'s "active permission */ \
126-
eosio_assert(code == N(yosemite), "onerror action's are only valid from the system account"); \
126+
eosio_assert(code == N(infrasys), "onerror action's are only valid from the system account"); \
127127
} \
128128
if( code == self || action == N(onerror) ) { \
129129
TYPE thiscontract( self ); \

contracts/infrablockchainlib/identity.hpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
/**
22
* @file
3-
* @copyright defined in yosemite/LICENSE.txt
3+
* @copyright defined in infrablockchain/LICENSE.txt
44
*/
55
#pragma once
66

77
#include <eosiolib/eosio.hpp>
88
#include <eosiolib/asset.hpp>
99
#include <infrablockchainlib/system_accounts.hpp>
1010

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
1313

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
2020

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
2626

27-
namespace yosemite { namespace identity {
27+
namespace infrablockchain { namespace identity {
2828

2929
using identity_type_t = uint16_t;
3030
using identity_kyc_t = uint16_t;
@@ -50,15 +50,15 @@ namespace yosemite { namespace identity {
5050
if (is_system_account(account)) {
5151
return identity_info{
5252
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, {}
5454
};
5555
}
56-
identity_idx identity_table(YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT);
56+
identity_idx identity_table(INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT);
5757
auto id_it = identity_table.find(account);
5858
if (id_it == identity_table.end()) {
5959
return identity_info{
6060
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, {}
6262
};
6363
} else {
6464
return *id_it;
@@ -67,19 +67,19 @@ namespace yosemite { namespace identity {
6767

6868
identity_type_t get_identity_account_type(const account_name account) {
6969
if (is_system_account(account)) {
70-
return YOSEMITE_ID_ACC_TYPE_SYSTEM;
70+
return INFRABLOCKCHAIN_ID_ACC_TYPE_SYSTEM;
7171
}
72-
identity_idx identity_table(YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT);
72+
identity_idx identity_table(INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT);
7373
auto id_it = identity_table.find(account);
7474
if (id_it == identity_table.end()) {
75-
return YOSEMITE_ID_ACC_TYPE_NORMAL;
75+
return INFRABLOCKCHAIN_ID_ACC_TYPE_NORMAL;
7676
} else {
7777
return id_it->type;
7878
}
7979
}
8080

8181
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;
8383
}
8484

8585
bool is_account_type(const account_name account, identity_type_t type_code) {
@@ -88,19 +88,19 @@ namespace yosemite { namespace identity {
8888

8989
identity_kyc_t get_identity_kyc_status(const account_name account) {
9090
if (is_system_account(account)) {
91-
return YOSEMITE_ID_KYC_MAX_AUTH;
91+
return INFRABLOCKCHAIN_ID_KYC_MAX_AUTH;
9292
}
93-
identity_idx identity_table(YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT);
93+
identity_idx identity_table(INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT);
9494
auto id_it = identity_table.find(account);
9595
if (id_it == identity_table.end()) {
96-
return YOSEMITE_ID_KYC_NO_AUTH;
96+
return INFRABLOCKCHAIN_ID_KYC_NO_AUTH;
9797
} else {
9898
return id_it->kyc;
9999
}
100100
}
101101

102102
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;
104104
}
105105

106106
bool has_kyc_status(const account_name account, identity_kyc_t kyc_flags) {
@@ -114,19 +114,19 @@ namespace yosemite { namespace identity {
114114

115115
identity_state_t get_identity_account_state(const account_name account) {
116116
if (is_system_account(account)) {
117-
return YOSEMITE_ID_ACC_STATE_CLEAR;
117+
return INFRABLOCKCHAIN_ID_ACC_STATE_CLEAR;
118118
}
119-
identity_idx identity_table(YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT);
119+
identity_idx identity_table(INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT);
120120
auto id_it = identity_table.find(account);
121121
if (id_it == identity_table.end()) {
122-
return YOSEMITE_ID_ACC_STATE_CLEAR;
122+
return INFRABLOCKCHAIN_ID_ACC_STATE_CLEAR;
123123
} else {
124124
return id_it->state;
125125
}
126126
}
127127

128128
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;
130130
}
131131

132132
bool has_account_state(const account_name account, identity_state_t state_flag) {
@@ -142,7 +142,7 @@ namespace yosemite { namespace identity {
142142
if (is_system_account(account)) {
143143
return std::string();
144144
}
145-
identity_idx identity_table(YOSEMITE_IDENTITY_ACCOUNT, YOSEMITE_IDENTITY_ACCOUNT);
145+
identity_idx identity_table(INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT, INFRABLOCKCHAIN_SYS_IDENTITY_ACCOUNT);
146146
auto id_it = identity_table.find(account);
147147
if (id_it == identity_table.end()) {
148148
return std::string();

contracts/infrablockchainlib/identity_authority.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* @file
3-
* @copyright defined in yosemite/LICENSE.txt
3+
* @copyright defined in infrablockchain/LICENSE.txt
44
*/
55
#pragma once
66

77
#include <infrablockchainlib/system_accounts.hpp>
88
#include <eosiolib/eosio.hpp>
99
#include <string>
1010

11-
namespace yosemite {
11+
namespace infrablockchain {
1212

1313
// The authorized Identity Authorities have the right for managing user info and KYC info on blockchain.
1414
struct identity_authority_info {
@@ -27,7 +27,7 @@ namespace yosemite {
2727
typedef eosio::multi_index< N(idauthority), identity_authority_info > identity_authority_table;
2828

2929
bool is_authorized_identity_authority( const account_name identity_authority ) {
30-
identity_authority_table idauthorities(YOSEMITE_SYSTEM_ACCOUNT, YOSEMITE_SYSTEM_ACCOUNT);
30+
identity_authority_table idauthorities(INFRABLOCKCHAIN_SYSTEM_ACCOUNT, INFRABLOCKCHAIN_SYSTEM_ACCOUNT);
3131
auto idauth = idauthorities.find( identity_authority );
3232
return idauth != idauthorities.end() && (*idauth).is_authorized;
3333
}

contracts/infrablockchainlib/infrablockchainlib.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @file
3-
* @copyright defined in yosemite-public-blockchain/LICENSE
3+
* @copyright defined in infrablockchain/LICENSE
44
*/
55

66
#include <eosiolib/action.hpp>
@@ -18,19 +18,19 @@ namespace yosemite {
1818
if (token.is_native()) {
1919
if (token.issuer == 0) {
2020
INLINE_ACTION_SENDER(yosemite::native_token::ntoken, transfer)
21-
(YOSEMITE_NATIVE_TOKEN_ACCOUNT, {{from, N(active)},
22-
{YOSEMITE_SYSTEM_ACCOUNT, N(active)}},
21+
(INFRABLOCKCHAIN_SYS_NATIVE_TOKEN_ACCOUNT, {{from, N(active)},
22+
{INFRABLOCKCHAIN_SYSTEM_ACCOUNT, N(active)}},
2323
{from, to, token, memo});
2424
} else {
2525
INLINE_ACTION_SENDER(yosemite::native_token::ntoken, ntransfer)
26-
(YOSEMITE_NATIVE_TOKEN_ACCOUNT, {{from, N(active)},
27-
{YOSEMITE_SYSTEM_ACCOUNT, N(active)}},
26+
(INFRABLOCKCHAIN_SYS_NATIVE_TOKEN_ACCOUNT, {{from, N(active)},
27+
{INFRABLOCKCHAIN_SYSTEM_ACCOUNT, N(active)}},
2828
{from, to, token, memo});
2929
}
3030
} else {
3131
INLINE_ACTION_SENDER(yosemite::non_native_token::token, transfer)
32-
(YOSEMITE_USER_TOKEN_ACCOUNT, {{from, N(active)},
33-
{YOSEMITE_SYSTEM_ACCOUNT, N(active)}},
32+
(INFRABLOCKCHAIN_SYS_USER_TOKEN_ACCOUNT, {{from, N(active)},
33+
{INFRABLOCKCHAIN_SYSTEM_ACCOUNT, N(active)}},
3434
{from, to, token, memo});
3535
}
3636
}
@@ -39,6 +39,8 @@ namespace yosemite {
3939

4040
namespace yosemite { namespace non_native_token {
4141

42+
using namespace infrablockchain;
43+
4244
void token::create(const yx_symbol &ysymbol, uint16_t can_set_options) {
4345
eosio_assert(static_cast<uint32_t>(ysymbol.is_valid()), "invalid ysymbol name");
4446
eosio_assert(static_cast<uint32_t>(!ysymbol.is_native(false)), "cannot create the native token with this action");
@@ -58,7 +60,7 @@ namespace yosemite { namespace non_native_token {
5860
s.kyc_rule_flags.clear();
5961
});
6062

61-
charge_fee(ysymbol.issuer, YOSEMITE_TX_FEE_OP_NAME_TOKEN_CREATE);
63+
charge_fee(ysymbol.issuer, INFRABLOCKCHAIN_TX_FEE_OP_NAME_TOKEN_CREATE);
6264
}
6365

6466
void token::add_token_balance(const account_name &owner, const yx_asset &token) {
@@ -136,12 +138,12 @@ namespace yosemite { namespace non_native_token {
136138
});
137139
}
138140

139-
charge_fee(ysymbol.issuer, YOSEMITE_TX_FEE_OP_NAME_TOKEN_SETKYCRULE);
141+
charge_fee(ysymbol.issuer, INFRABLOCKCHAIN_TX_FEE_OP_NAME_TOKEN_SETKYCRULE);
140142
}
141143

142144
bool token::check_identity_auth_for_transfer(account_name account, const token_rule_type &kycrule_type,
143145
const token_stats &tstats) {
144-
eosio_assert(static_cast<uint32_t>(!identity::has_account_state(account, YOSEMITE_ID_ACC_STATE_BLACKLISTED)),
146+
eosio_assert(static_cast<uint32_t>(!identity::has_account_state(account, INFRABLOCKCHAIN_ID_ACC_STATE_BLACKLISTED)),
145147
"account is blacklisted by identity authority");
146148

147149
auto itr = std::find(tstats.kyc_rules.begin(), tstats.kyc_rules.end(), kycrule_type);
@@ -173,7 +175,7 @@ namespace yosemite { namespace non_native_token {
173175
}
174176
});
175177

176-
charge_fee(ysymbol.issuer, YOSEMITE_TX_FEE_OP_NAME_TOKEN_SETOPTIONS);
178+
charge_fee(ysymbol.issuer, INFRABLOCKCHAIN_TX_FEE_OP_NAME_TOKEN_SETOPTIONS);
177179
}
178180

179181
void token::freezeacc(const yx_symbol &ysymbol, const vector<account_name> &accs, bool freeze) {
@@ -202,7 +204,7 @@ namespace yosemite { namespace non_native_token {
202204
});
203205
}
204206

205-
charge_fee(ysymbol.issuer, YOSEMITE_TX_FEE_OP_NAME_TOKEN_FREEZEACC);
207+
charge_fee(ysymbol.issuer, INFRABLOCKCHAIN_TX_FEE_OP_NAME_TOKEN_FREEZEACC);
206208
}
207209

208210
void token::check_issue_parameters(const account_name &to, const yx_asset &token, const string &memo) {

contracts/infrablockchainlib/native_token.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@
99
#include <infrablockchainlib/identity.hpp>
1010
#include <infrablockchainlib/trx_fee_api.h>
1111

12+
// DEPRECATED
13+
1214
/* Some constants must be sync with plugins/chain_plugin/chain_plugin.cpp::get_account(). */
1315

16+
1417
namespace yosemite { namespace native_token {
1518
static const uint64_t NTOKEN_TOTAL_BALANCE_KEY = N(totalbal);
1619

1720
using namespace eosio;
1821
using std::string;
22+
using namespace infrablockchain;
1923

2024
static const uint64_t NTOKEN_BASIC_STATS_KEY = N(basicstats);
2125

26+
// DEPRECATED
2227
class ntoken : public contract {
2328
public:
2429
explicit ntoken(account_name self) : contract(self) {
@@ -84,13 +89,13 @@ namespace yosemite { namespace native_token {
8489
typedef eosio::multi_index<N(ntaccountstt), total_balance> accounts_native_total;
8590

8691
int64_t get_total_native_token_balance(const account_name &owner) {
87-
accounts_native_total accounts_total_table(YOSEMITE_NATIVE_TOKEN_ACCOUNT, owner);
92+
accounts_native_total accounts_total_table(INFRABLOCKCHAIN_SYS_NATIVE_TOKEN_ACCOUNT, owner);
8893
const auto &balance_holder = accounts_total_table.get(NTOKEN_TOTAL_BALANCE_KEY, "account doesn't have native token balance");
8994
return balance_holder.amount.amount;
9095
}
9196

9297
void charge_transaction_fee(account_name payer, uint64_t operation) {
93-
auto tx_fee = yosemite::get_transaction_fee(operation);
98+
auto tx_fee = get_transaction_fee(operation);
9499
if (tx_fee.amount > 0) {
95100
account_name tx_fee_payer = trx_fee_payer();
96101
if (tx_fee_payer != 0) {
@@ -104,7 +109,7 @@ namespace yosemite { namespace native_token {
104109
}
105110

106111
INLINE_ACTION_SENDER(ntoken, payfee)
107-
(YOSEMITE_NATIVE_TOKEN_ACCOUNT, {{payer, N(active)}, {YOSEMITE_SYSTEM_ACCOUNT, N(active)}},
112+
(INFRABLOCKCHAIN_SYS_NATIVE_TOKEN_ACCOUNT, {{payer, N(active)}, {INFRABLOCKCHAIN_SYSTEM_ACCOUNT, N(active)}},
108113
{payer, tx_fee});
109114
}
110115
}

0 commit comments

Comments
 (0)