Skip to content

Commit eb85b66

Browse files
committed
Cleanup after merging master steemit#2478
1 parent 830e410 commit eb85b66

File tree

11 files changed

+22
-42
lines changed

11 files changed

+22
-42
lines changed

Diff for: Doxyfile

-10
Original file line numberDiff line numberDiff line change
@@ -1972,16 +1972,6 @@ INCLUDE_PATH =
19721972

19731973
INCLUDE_FILE_PATTERNS =
19741974

1975-
# The PREDEFINED tag can be used to specify one or more macro names that are
1976-
# defined before the preprocessor is started (similar to the -D option of e.g.
1977-
# gcc). The argument of the tag is a list of macros of the form: name or
1978-
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
1979-
# is assumed. To prevent a macro definition from being undefined via #undef or
1980-
# recursively expanded use the := operator instead of the = operator.
1981-
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
1982-
1983-
PREDEFINED = STEEM_ENABLE_SMT
1984-
19851975
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
19861976
# tag can be used to specify a list of macro names that should be expanded. The
19871977
# macro definition that is found in the sources will be used. Use the PREDEFINED

Diff for: libraries/chain/database.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1668,9 +1668,9 @@ void database::process_vesting_withdrawals()
16681668
const auto& token = get< smt_token_object, by_symbol >( iter->get_liquid_symbol() );
16691669
share_type to_withdraw;
16701670
if ( iter->to_withdraw - iter->withdrawn < iter->vesting_withdraw_rate.amount )
1671-
to_withdraw = std::min( iter->vesting.amount, iter->to_withdraw % iter->vesting_withdraw_rate.amount ).value;
1671+
to_withdraw = std::min( iter->vesting_shares.amount, iter->to_withdraw % iter->vesting_withdraw_rate.amount ).value;
16721672
else
1673-
to_withdraw = std::min( iter->vesting.amount, iter->vesting_withdraw_rate.amount ).value;
1673+
to_withdraw = std::min( iter->vesting_shares.amount, iter->vesting_withdraw_rate.amount ).value;
16741674

16751675
auto withdraw_token = asset( to_withdraw, token.liquid_symbol.get_paired_symbol() );
16761676
auto converted_token = withdraw_token * token.get_vesting_share_price();
@@ -1681,11 +1681,11 @@ void database::process_vesting_withdrawals()
16811681

16821682
modify( *iter, [&]( account_regular_balance_object& a )
16831683
{
1684-
a.vesting -= withdraw_token;
1685-
a.liquid += converted_token;
1686-
a.withdrawn += to_withdraw;
1684+
a.vesting_shares -= withdraw_token;
1685+
a.liquid += converted_token;
1686+
a.withdrawn += to_withdraw;
16871687

1688-
if ( a.withdrawn >= a.to_withdraw || a.vesting.amount == 0 )
1688+
if ( a.withdrawn >= a.to_withdraw || a.vesting_shares.amount == 0 )
16891689
{
16901690
a.vesting_withdraw_rate.amount = 0;
16911691
a.next_vesting_withdrawal = fc::time_point_sec::maximum();

Diff for: libraries/chain/include/steem/chain/smt_objects/account_balance_object.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class account_regular_balance_object : public object< account_regular_balance_ob
5454
vesting_withdraw_rate = asset( 0, liquid_symbol.get_paired_symbol() );
5555
}
5656

57-
void add_vesting( const asset& vesting_shares, const asset& vesting_value )
57+
void add_vesting( const asset& shares, const asset& vesting_value )
5858
{
5959
// There's no need to store vesting value (in liquid SMT variant) in regular balance.
6060
vesting_shares += shares;

Diff for: libraries/chain/steem_evaluator.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ void withdraw_vesting_evaluator::do_apply( const withdraw_vesting_operation& o )
12571257
const auto* bal_obj = _db.find< account_regular_balance_object, by_owner_liquid_symbol >( boost::make_tuple( account.name, liquid_symbol ) );
12581258

12591259
FC_ASSERT( bal_obj != nullptr, "Account does not have sufficient Token Power for withdrawal." );
1260-
FC_ASSERT( bal_obj->vesting - bal_obj->delegated_vesting_shares >= o.vesting_shares, "Account does not have sufficient Token Power for withdrawal." );
1260+
FC_ASSERT( bal_obj->vesting_shares - bal_obj->delegated_vesting_shares >= o.vesting_shares, "Account does not have sufficient Token Power for withdrawal." );
12611261

12621262
if ( o.vesting_shares.amount == 0 )
12631263
{
@@ -2251,7 +2251,6 @@ void vote_evaluator::do_apply( const vote_operation& o )
22512251
}
22522252
} FC_CAPTURE_AND_RETHROW( (o) ) }
22532253

2254-
#ifdef STEEM_ENABLE_SMT
22552254
template< typename VoteType >
22562255
struct vote_context
22572256
{
@@ -2644,7 +2643,6 @@ void vote2_evaluator::do_apply( const vote2_operation& o )
26442643
generic_vote_evaluator( ctx, voter, _db );
26452644
}
26462645
}
2647-
#endif
26482646

26492647
void custom_evaluator::do_apply( const custom_operation& o )
26502648
{

Diff for: libraries/plugins/rc/resource_count.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,11 @@ struct count_operation_visitor
152152
execution_time_count += _e.vote_operation_exec_time;
153153
}
154154

155-
#ifdef STEEM_ENABLE_SMT
156155
void operator()( const vote2_operation& op )const
157156
{
158157
state_bytes_count += _w.comment_vote_object_base_size * ( op.smt_rshares.size() + 1 );
159158
execution_time_count += _e.vote_operation_exec_time * ( op.smt_rshares.size() + 1 );
160159
}
161-
#endif
162160

163161
void operator()( const witness_update_operation& op )const
164162
{

Diff for: libraries/protocol/get_config.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ fc::variant_object get_config()
1717
result[ "IS_TEST_NET" ] = false;
1818
#endif
1919

20-
result[ "STEEM_ENABLE_SMT" ] = true;
2120
result["SMT_MAX_VOTABLE_ASSETS"] = SMT_MAX_VOTABLE_ASSETS;
2221
result["SMT_VESTING_WITHDRAW_INTERVAL_SECONDS"] = SMT_VESTING_WITHDRAW_INTERVAL_SECONDS;
2322
result["SMT_UPVOTE_LOCKOUT"] = SMT_UPVOTE_LOCKOUT;

Diff for: libraries/protocol/include/steem/protocol/steem_operations.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ namespace steem { namespace protocol {
243243
void get_required_posting_authorities( flat_set<account_name_type>& a )const{ a.insert(voter); }
244244
};
245245

246-
#ifdef STEEM_ENABLE_SMT
247246
struct vote2_operation : public base_operation
248247
{
249248
account_name_type voter;
@@ -258,7 +257,6 @@ namespace steem { namespace protocol {
258257
void validate()const;
259258
void get_required_posting_authorities( flat_set< account_name_type >& a )const { a.insert( voter ); }
260259
};
261-
#endif
262260

263261
/**
264262
* @ingroup operations

Diff for: libraries/protocol/steem_operations.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,12 @@ namespace steem { namespace protocol {
239239
validate_permlink( permlink );
240240
}
241241

242-
#ifdef STEEM_ENABLE_SMT
243242
void vote2_operation::validate() const
244243
{
245244
validate_account_name( voter );
246245
validate_account_name( author );
247246
validate_permlink( permlink );
248247
}
249-
#endif
250248

251249
void transfer_operation::validate() const
252250
{ try {

Diff for: python_scripts/tests/api_tests/database_api/get_config.json.pat

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"STEEM_CREATE_ACCOUNT_WITH_STEEM_MODIFIER": 30,
4242
"STEEM_CURATE_APR_PERCENT": 3875,
4343
"STEEM_DEFAULT_SBD_INTEREST_RATE": 1000,
44-
"STEEM_ENABLE_SMT": true,
4544
"STEEM_EQUIHASH_K": 6,
4645
"STEEM_EQUIHASH_N": 140,
4746
"STEEM_FEED_HISTORY_WINDOW": 84,

Diff for: tests/tests/smt_operation_tests.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1422,13 +1422,13 @@ BOOST_AUTO_TEST_CASE( smt_withdraw_vesting_apply )
14221422
tx.operations.clear();
14231423
tx.signatures.clear();
14241424

1425-
op.vesting_shares = asset( balance_obj->vesting.amount / 3, symbol.get_paired_symbol() );
1425+
op.vesting_shares = asset( balance_obj->vesting_shares.amount / 3, symbol.get_paired_symbol() );
14261426
tx.operations.push_back( op );
14271427
tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION );
14281428
sign( tx, alice_private_key );
14291429
db->push_transaction( tx, 0 );
14301430

1431-
BOOST_REQUIRE( balance_obj->vesting.amount.value == old_vesting_shares.amount.value );
1431+
BOOST_REQUIRE( balance_obj->vesting_shares.amount.value == old_vesting_shares.amount.value );
14321432
BOOST_REQUIRE( balance_obj->vesting_withdraw_rate.amount.value == ( old_vesting_shares.amount / ( STEEM_VESTING_WITHDRAW_INTERVALS * 3 ) ).value + 1 );
14331433
BOOST_REQUIRE( balance_obj->to_withdraw.value == op.vesting_shares.amount.value );
14341434
BOOST_REQUIRE( balance_obj->next_vesting_withdrawal == db->head_block_time() + SMT_VESTING_WITHDRAW_INTERVAL_SECONDS );
@@ -1438,13 +1438,13 @@ BOOST_AUTO_TEST_CASE( smt_withdraw_vesting_apply )
14381438
tx.operations.clear();
14391439
tx.signatures.clear();
14401440

1441-
op.vesting_shares = asset( balance_obj->vesting.amount * 2, symbol.get_paired_symbol() );
1441+
op.vesting_shares = asset( balance_obj->vesting_shares.amount * 2, symbol.get_paired_symbol() );
14421442
tx.operations.push_back( op );
14431443
tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION );
14441444
sign( tx, alice_private_key );
14451445
STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception );
14461446

1447-
BOOST_REQUIRE( balance_obj->vesting.amount.value == old_vesting_shares.amount.value );
1447+
BOOST_REQUIRE( balance_obj->vesting_shares.amount.value == old_vesting_shares.amount.value );
14481448
BOOST_REQUIRE( balance_obj->vesting_withdraw_rate.amount.value == ( old_vesting_shares.amount / ( STEEM_VESTING_WITHDRAW_INTERVALS * 3 ) ).value + 1 );
14491449
BOOST_REQUIRE( balance_obj->next_vesting_withdrawal == db->head_block_time() + SMT_VESTING_WITHDRAW_INTERVAL_SECONDS );
14501450
validate_database();
@@ -1459,7 +1459,7 @@ BOOST_AUTO_TEST_CASE( smt_withdraw_vesting_apply )
14591459
sign( tx, alice_private_key );
14601460
db->push_transaction( tx, 0 );
14611461

1462-
BOOST_REQUIRE( balance_obj->vesting.amount.value == old_vesting_shares.amount.value );
1462+
BOOST_REQUIRE( balance_obj->vesting_shares.amount.value == old_vesting_shares.amount.value );
14631463
BOOST_REQUIRE( balance_obj->vesting_withdraw_rate.amount.value == 0 );
14641464
BOOST_REQUIRE( balance_obj->to_withdraw.value == 0 );
14651465
BOOST_REQUIRE( balance_obj->next_vesting_withdrawal == fc::time_point_sec::maximum() );
@@ -4663,7 +4663,7 @@ BOOST_AUTO_TEST_CASE( vote2_apply )
46634663
ACTORS( (alice)(bob)(sam)(dave) )
46644664
generate_block();
46654665

4666-
4666+
46674667

46684668
vest( STEEM_INIT_MINER_NAME, "alice", ASSET( "10.000 TESTS" ) );
46694669
validate_database();

Diff for: tests/tests/smt_operation_time_tests.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -1167,28 +1167,28 @@ BOOST_AUTO_TEST_CASE( smt_vesting_withdrawals )
11671167
signed_transaction tx;
11681168
withdraw_vesting_operation op;
11691169
op.account = "alice";
1170-
op.vesting_shares = asset( balance_obj->vesting.amount / 2, symbol.get_paired_symbol() );
1170+
op.vesting_shares = asset( balance_obj->vesting_shares.amount / 2, symbol.get_paired_symbol() );
11711171
tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION );
11721172
tx.operations.push_back( op );
11731173
sign( tx, alice_private_key );
11741174
db->push_transaction( tx, 0 );
11751175

11761176
auto next_withdrawal = db->head_block_time() + SMT_VESTING_WITHDRAW_INTERVAL_SECONDS;
1177-
asset vesting_shares = balance_obj->vesting;
1177+
asset vesting_shares = balance_obj->vesting_shares;
11781178
asset original_vesting = vesting_shares;
11791179
asset withdraw_rate = balance_obj->vesting_withdraw_rate;
11801180

11811181
BOOST_TEST_MESSAGE( " -- Generating block up to first withdrawal" );
11821182
generate_blocks( next_withdrawal - ( STEEM_BLOCK_INTERVAL / 2 ), true);
11831183

1184-
BOOST_REQUIRE( balance_obj->vesting.amount.value == vesting_shares.amount.value );
1184+
BOOST_REQUIRE( balance_obj->vesting_shares.amount.value == vesting_shares.amount.value );
11851185

11861186
BOOST_TEST_MESSAGE( " -- Generating block to cause withdrawal" );
11871187
generate_block();
11881188

11891189
auto fill_op = get_last_operations( 1 )[ 0 ].get< fill_vesting_withdraw_operation >();
11901190

1191-
BOOST_REQUIRE( balance_obj->vesting.amount.value == ( vesting_shares - withdraw_rate ).amount.value );
1191+
BOOST_REQUIRE( balance_obj->vesting_shares.amount.value == ( vesting_shares - withdraw_rate ).amount.value );
11921192
BOOST_REQUIRE( ( withdraw_rate * token.get_vesting_share_price() ).amount.value - balance_obj->liquid.amount.value <= 1 ); // Check a range due to differences in the share price
11931193
BOOST_REQUIRE( fill_op.from_account == "alice" );
11941194
BOOST_REQUIRE( fill_op.to_account == "alice" );
@@ -1198,7 +1198,7 @@ BOOST_AUTO_TEST_CASE( smt_vesting_withdrawals )
11981198

11991199
BOOST_TEST_MESSAGE( " -- Generating the rest of the blocks in the withdrawal" );
12001200

1201-
vesting_shares = balance_obj->vesting;
1201+
vesting_shares = balance_obj->vesting_shares;
12021202
auto balance = balance_obj->liquid;
12031203
auto old_next_vesting = balance_obj->next_vesting_withdrawal;
12041204

@@ -1208,7 +1208,7 @@ BOOST_AUTO_TEST_CASE( smt_vesting_withdrawals )
12081208

12091209
fill_op = get_last_operations( 2 )[ 1 ].get< fill_vesting_withdraw_operation >();
12101210

1211-
BOOST_REQUIRE( balance_obj->vesting.amount.value == ( vesting_shares - withdraw_rate ).amount.value );
1211+
BOOST_REQUIRE( balance_obj->vesting_shares.amount.value == ( vesting_shares - withdraw_rate ).amount.value );
12121212
BOOST_REQUIRE( balance.amount.value + ( withdraw_rate * token.get_vesting_share_price() ).amount.value - balance_obj->liquid.amount.value <= 1 );
12131213
BOOST_REQUIRE( fill_op.from_account == "alice" );
12141214
BOOST_REQUIRE( fill_op.to_account == "alice" );
@@ -1222,7 +1222,7 @@ BOOST_AUTO_TEST_CASE( smt_vesting_withdrawals )
12221222

12231223
validate_database();
12241224

1225-
vesting_shares = balance_obj->vesting;
1225+
vesting_shares = balance_obj->vesting_shares;
12261226
balance = balance_obj->liquid;
12271227
old_next_vesting = balance_obj->next_vesting_withdrawal;
12281228
}
@@ -1231,7 +1231,7 @@ BOOST_AUTO_TEST_CASE( smt_vesting_withdrawals )
12311231
generate_blocks( db->head_block_time() + SMT_VESTING_WITHDRAW_INTERVAL_SECONDS, true );
12321232

12331233
BOOST_REQUIRE( balance_obj->next_vesting_withdrawal.sec_since_epoch() == fc::time_point_sec::maximum().sec_since_epoch() );
1234-
BOOST_REQUIRE( balance_obj->vesting.amount.value == ( original_vesting - op.vesting_shares ).amount.value );
1234+
BOOST_REQUIRE( balance_obj->vesting_shares.amount.value == ( original_vesting - op.vesting_shares ).amount.value );
12351235

12361236
validate_database();
12371237
}

0 commit comments

Comments
 (0)