Skip to content

Commit

Permalink
Issue steemit#1268 STEEMIT_ constant prefix renamed to STEEM_
Browse files Browse the repository at this point in the history
All constant renamed as requested except STEEMIT_SYMBOL (now STEEM_SYMBOL_NAME), which name conflicted to STEEM_SYMBOL.
  • Loading branch information
vogel76 committed Sep 7, 2017
1 parent 718b6d6 commit 728685e
Show file tree
Hide file tree
Showing 96 changed files with 2,018 additions and 2,018 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ if(ENABLE_COVERAGE_TESTING)
SET(CMAKE_CXX_FLAGS "--coverage ${CMAKE_CXX_FLAGS}")
endif()

# external_plugins needs to be compiled first because libraries/app depends on STEEMIT_EXTERNAL_PLUGINS being fully populated
# external_plugins needs to be compiled first because libraries/app depends on STEEM_EXTERNAL_PLUGINS being fully populated
add_subdirectory( external_plugins )
add_subdirectory( libraries )
add_subdirectory( programs )
Expand Down
2 changes: 1 addition & 1 deletion doc/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
How plugins work
----------------

All plugins in the `libraries/plugins` directory are iterated over by `CMakeLists.txt` and placed in a CMake environment variable `STEEMIT_INTERNAL_PLUGINS`, which is used to create a runtime-accessible list of available plugins used by the argument parsing.
All plugins in the `libraries/plugins` directory are iterated over by `CMakeLists.txt` and placed in a CMake environment variable `STEEM_INTERNAL_PLUGINS`, which is used to create a runtime-accessible list of available plugins used by the argument parsing.

Similarly, `external_plugins` is set aside for third-party plugins. Just drop plugin code into `external_plugins` directory, `make steemd`, and the new plugin will be available.

Expand Down
4 changes: 2 additions & 2 deletions example_plugins/hello_api/hello_api_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ std::string hello_api_api::get_message()
} }

/**
* The STEEMIT_DEFINE_PLUGIN() macro will define a steemit::plugin::create_hello_api_plugin()
* The STEEM_DEFINE_PLUGIN() macro will define a steemit::plugin::create_hello_api_plugin()
* factory method which is expected by the manifest.
*/

STEEMIT_DEFINE_PLUGIN( hello_api, steemit::example_plugin::hello_api_plugin )
STEEM_DEFINE_PLUGIN( hello_api, steemit::example_plugin::hello_api_plugin )
594 changes: 297 additions & 297 deletions libraries/chain/database.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libraries/chain/fork_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void fork_database::_push_block(const item_ptr& item)
{
auto& index = _index.get<block_id>();
auto itr = index.find(item->previous_id());
STEEMIT_ASSERT(itr != index.end(), unlinkable_block_exception, "block does not link to known chain");
STEEM_ASSERT(itr != index.end(), unlinkable_block_exception, "block does not link to known chain");
FC_ASSERT(!(*itr)->invalid);
item->prev = *itr;
}
Expand Down
8 changes: 4 additions & 4 deletions libraries/chain/include/steemit/chain/account_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ namespace steemit { namespace chain {
time_point_sec last_owner_proved = time_point_sec::min();
time_point_sec last_active_proved = time_point_sec::min();
account_name_type recovery_account;
account_name_type reset_account = STEEMIT_NULL_ACCOUNT;
account_name_type reset_account = STEEM_NULL_ACCOUNT;
time_point_sec last_account_recovery;
uint32_t comment_count = 0;
uint32_t lifetime_vote_count = 0;
uint32_t post_count = 0;

bool can_vote = true;
uint16_t voting_power = STEEMIT_100_PERCENT; ///< current voting power of this account, it falls after every vote
uint16_t voting_power = STEEM_100_PERCENT; ///< current voting power of this account, it falls after every vote
time_point_sec last_vote_time; ///< used to increase the voting power of this account the longer it goes without voting.

asset balance = asset( 0, STEEM_SYMBOL ); ///< total liquid shares held by this account
Expand All @@ -65,7 +65,7 @@ namespace steemit { namespace chain {
* interest = interest_rate * sbd_seconds / seconds_per_year
*
* Every time the sbd_balance is updated the sbd_seconds is also updated. If at least
* STEEMIT_MIN_COMPOUNDING_INTERVAL_SECONDS has past since sbd_last_interest_payment then
* STEEM_MIN_COMPOUNDING_INTERVAL_SECONDS has past since sbd_last_interest_payment then
* interest is added to sbd_balance.
*
* @defgroup sbd_data sbd Balance Data
Expand Down Expand Up @@ -103,7 +103,7 @@ namespace steemit { namespace chain {
share_type to_withdraw = 0; /// Might be able to look this up with operation history.
uint16_t withdraw_routes = 0;

fc::array<share_type, STEEMIT_MAX_PROXY_RECURSION_DEPTH> proxied_vsf_votes;// = std::vector<share_type>( STEEMIT_MAX_PROXY_RECURSION_DEPTH, 0 ); ///< the total VFS votes proxied to this account
fc::array<share_type, STEEM_MAX_PROXY_RECURSION_DEPTH> proxied_vsf_votes;// = std::vector<share_type>( STEEM_MAX_PROXY_RECURSION_DEPTH, 0 ); ///< the total VFS votes proxied to this account

uint16_t witnesses_voted_for = 0;

Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/steemit/chain/comment_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace steemit { namespace chain {
id_type root_comment;

asset max_accepted_payout = asset( 1000000000, SBD_SYMBOL ); /// SBD value of the maximum payout this post will receive
uint16_t percent_steem_dollars = STEEMIT_100_PERCENT; /// the percent of Steem Dollars to key, unkept amounts will be received as Steem Power
uint16_t percent_steem_dollars = STEEM_100_PERCENT; /// the percent of Steem Dollars to key, unkept amounts will be received as Steem Power
bool allow_replies = true; /// allows a post to disable replies.
bool allow_votes = true; /// allows a post to receive votes;
bool allow_curation_rewards = true;
Expand Down
12 changes: 6 additions & 6 deletions libraries/chain/include/steemit/chain/compound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ share_type calc_percent_reward( share_type current_supply )
static_assert( shift_constant > 0, "shift constant cannot be zero" );
static_assert( shift_constant < 128, "shift constant is implausibly large, re-check your arguments" );
static_assert( multiply_constant > 256, "multiply constant is implausibly small, re-check your arguments" );
static_assert( multiply_constant < UINT64_MAX / (10 * uint64_t( STEEMIT_100_PERCENT )), "multiply constant is too large, we may be in danger of overflow" );
static_assert( (percent == 0) || (percent > STEEMIT_1_PERCENT), "percent is smaller than 1%, re-check your arguments" );
static_assert( percent <= STEEMIT_100_PERCENT, "percent is implausibly large, re-check your arguments (if you really mean to do this, you should revise the overflow check above accordingly)" );
static_assert( multiply_constant < UINT64_MAX / (10 * uint64_t( STEEM_100_PERCENT )), "multiply constant is too large, we may be in danger of overflow" );
static_assert( (percent == 0) || (percent > STEEM_1_PERCENT), "percent is smaller than 1%, re-check your arguments" );
static_assert( percent <= STEEM_100_PERCENT, "percent is implausibly large, re-check your arguments (if you really mean to do this, you should revise the overflow check above accordingly)" );

static const uint128_t half = uint128_t(1) << (shift_constant - 1);

Expand All @@ -31,19 +31,19 @@ share_type calc_percent_reward( share_type current_supply )
template< uint16_t percent >
inline share_type calc_percent_reward_per_hour( share_type current_supply )
{
return calc_percent_reward< percent, STEEMIT_APR_PERCENT_MULTIPLY_PER_HOUR, STEEMIT_APR_PERCENT_SHIFT_PER_HOUR >( current_supply );
return calc_percent_reward< percent, STEEM_APR_PERCENT_MULTIPLY_PER_HOUR, STEEM_APR_PERCENT_SHIFT_PER_HOUR >( current_supply );
}

template< uint16_t percent >
inline share_type calc_percent_reward_per_block( share_type current_supply )
{
return calc_percent_reward< percent, STEEMIT_APR_PERCENT_MULTIPLY_PER_BLOCK, STEEMIT_APR_PERCENT_SHIFT_PER_BLOCK >( current_supply );
return calc_percent_reward< percent, STEEM_APR_PERCENT_MULTIPLY_PER_BLOCK, STEEM_APR_PERCENT_SHIFT_PER_BLOCK >( current_supply );
}

template< uint16_t percent >
inline share_type calc_percent_reward_per_round( share_type current_supply )
{
return calc_percent_reward< percent, STEEMIT_APR_PERCENT_MULTIPLY_PER_ROUND, STEEMIT_APR_PERCENT_SHIFT_PER_ROUND >( current_supply );
return calc_percent_reward< percent, STEEM_APR_PERCENT_MULTIPLY_PER_ROUND, STEEM_APR_PERCENT_SHIFT_PER_ROUND >( current_supply );
}

} }
12 changes: 6 additions & 6 deletions libraries/chain/include/steemit/chain/database.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace steemit { namespace chain {
*
* @param data_dir Path to open or create database in
*/
void open( const fc::path& data_dir, const fc::path& shared_mem_dir, uint64_t initial_supply = STEEMIT_INIT_SUPPLY, uint64_t shared_file_size = 0, uint32_t chainbase_flags = 0 );
void open( const fc::path& data_dir, const fc::path& shared_mem_dir, uint64_t initial_supply = STEEM_INIT_SUPPLY, uint64_t shared_file_size = 0, uint32_t chainbase_flags = 0 );

/**
* @brief Rebuild object graph from block history and open detabase
Expand Down Expand Up @@ -259,7 +259,7 @@ namespace steemit { namespace chain {
* Use the get_slot_time() and get_slot_at_time() functions
* to convert between slot_num and timestamp.
*
* Passing slot_num == 0 returns STEEMIT_NULL_WITNESS
* Passing slot_num == 0 returns STEEM_NULL_WITNESS
*/
account_name_type get_scheduled_witness(uint32_t slot_num)const;

Expand Down Expand Up @@ -302,7 +302,7 @@ namespace steemit { namespace chain {

/** this updates the votes for witnesses as a result of account voting proxy changing */
void adjust_proxied_witness_votes( const account_object& a,
const std::array< share_type, STEEMIT_MAX_PROXY_RECURSION_DEPTH+1 >& delta,
const std::array< share_type, STEEM_MAX_PROXY_RECURSION_DEPTH+1 >& delta,
int depth = 0 );

/** this updates the votes for all witnesses as a result of account VESTS changing */
Expand Down Expand Up @@ -366,7 +366,7 @@ namespace steemit { namespace chain {
/// Reset the object graph in-memory
void initialize_indexes();
void init_schema();
void init_genesis(uint64_t initial_supply = STEEMIT_INIT_SUPPLY );
void init_genesis(uint64_t initial_supply = STEEM_INIT_SUPPLY );

/**
* This method validates transactions without adding it to the pending state.
Expand Down Expand Up @@ -455,8 +455,8 @@ namespace steemit { namespace chain {

vector< signed_transaction > _pending_tx;
fork_database _fork_db;
fc::time_point_sec _hardfork_times[ STEEMIT_NUM_HARDFORKS + 1 ];
protocol::hardfork_version _hardfork_versions[ STEEMIT_NUM_HARDFORKS + 1 ];
fc::time_point_sec _hardfork_times[ STEEM_NUM_HARDFORKS + 1 ];
protocol::hardfork_version _hardfork_versions[ STEEM_NUM_HARDFORKS + 1 ];

block_log _block_log;

Expand Down
30 changes: 15 additions & 15 deletions libraries/chain/include/steemit/chain/database_exceptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <steemit/protocol/exceptions.hpp>

#define STEEMIT_DECLARE_OP_BASE_EXCEPTIONS( op_name ) \
#define STEEM_DECLARE_OP_BASE_EXCEPTIONS( op_name ) \
FC_DECLARE_DERIVED_EXCEPTION( \
op_name ## _validate_exception, \
steemit::chain::operation_validate_exception, \
Expand All @@ -16,7 +16,7 @@
#op_name "_operation evaluation exception" \
)

#define STEEMIT_DECLARE_OP_VALIDATE_EXCEPTION( exc_name, op_name, seqnum, msg ) \
#define STEEM_DECLARE_OP_VALIDATE_EXCEPTION( exc_name, op_name, seqnum, msg ) \
FC_DECLARE_DERIVED_EXCEPTION( \
op_name ## _ ## exc_name, \
steemit::chain::op_name ## _validate_exception, \
Expand All @@ -25,7 +25,7 @@
msg \
)

#define STEEMIT_DECLARE_OP_EVALUATE_EXCEPTION( exc_name, op_name, seqnum, msg ) \
#define STEEM_DECLARE_OP_EVALUATE_EXCEPTION( exc_name, op_name, seqnum, msg ) \
FC_DECLARE_DERIVED_EXCEPTION( \
op_name ## _ ## exc_name, \
steemit::chain::op_name ## _evaluate_exception, \
Expand All @@ -34,15 +34,15 @@
msg \
)

#define STEEMIT_DECLARE_INTERNAL_EXCEPTION( exc_name, seqnum, msg ) \
#define STEEM_DECLARE_INTERNAL_EXCEPTION( exc_name, seqnum, msg ) \
FC_DECLARE_DERIVED_EXCEPTION( \
internal_ ## exc_name, \
steemit::chain::internal_exception, \
4990000 + seqnum, \
msg \
)

#define STEEMIT_TRY_NOTIFY( signal, ... ) \
#define STEEM_TRY_NOTIFY( signal, ... ) \
try \
{ \
signal( __VA_ARGS__ ); \
Expand Down Expand Up @@ -80,21 +80,21 @@ namespace steemit { namespace chain {

FC_DECLARE_DERIVED_EXCEPTION( pop_empty_chain, steemit::chain::undo_database_exception, 4070001, "there are no blocks to pop" )

STEEMIT_DECLARE_OP_BASE_EXCEPTIONS( transfer );
// STEEMIT_DECLARE_OP_EVALUATE_EXCEPTION( from_account_not_whitelisted, transfer, 1, "owner mismatch" )
STEEM_DECLARE_OP_BASE_EXCEPTIONS( transfer );
// STEEM_DECLARE_OP_EVALUATE_EXCEPTION( from_account_not_whitelisted, transfer, 1, "owner mismatch" )

STEEMIT_DECLARE_OP_BASE_EXCEPTIONS( account_create );
STEEMIT_DECLARE_OP_EVALUATE_EXCEPTION( max_auth_exceeded, account_create, 1, "Exceeds max authority fan-out" )
STEEMIT_DECLARE_OP_EVALUATE_EXCEPTION( auth_account_not_found, account_create, 2, "Auth account not found" )
STEEM_DECLARE_OP_BASE_EXCEPTIONS( account_create );
STEEM_DECLARE_OP_EVALUATE_EXCEPTION( max_auth_exceeded, account_create, 1, "Exceeds max authority fan-out" )
STEEM_DECLARE_OP_EVALUATE_EXCEPTION( auth_account_not_found, account_create, 2, "Auth account not found" )

STEEMIT_DECLARE_OP_BASE_EXCEPTIONS( account_update );
STEEMIT_DECLARE_OP_EVALUATE_EXCEPTION( max_auth_exceeded, account_update, 1, "Exceeds max authority fan-out" )
STEEMIT_DECLARE_OP_EVALUATE_EXCEPTION( auth_account_not_found, account_update, 2, "Auth account not found" )
STEEM_DECLARE_OP_BASE_EXCEPTIONS( account_update );
STEEM_DECLARE_OP_EVALUATE_EXCEPTION( max_auth_exceeded, account_update, 1, "Exceeds max authority fan-out" )
STEEM_DECLARE_OP_EVALUATE_EXCEPTION( auth_account_not_found, account_update, 2, "Auth account not found" )

FC_DECLARE_DERIVED_EXCEPTION( internal_exception, steemit::chain::chain_exception, 4990000, "internal exception" )

STEEMIT_DECLARE_INTERNAL_EXCEPTION( verify_auth_max_auth_exceeded, 1, "Exceeds max authority fan-out" )
STEEMIT_DECLARE_INTERNAL_EXCEPTION( verify_auth_account_not_found, 2, "Auth account not found" )
STEEM_DECLARE_INTERNAL_EXCEPTION( verify_auth_max_auth_exceeded, 1, "Exceeds max authority fan-out" )
STEEM_DECLARE_INTERNAL_EXCEPTION( verify_auth_account_not_found, 2, "Auth account not found" )

} } // steemit::chain

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace steemit { namespace chain {
*/
uint16_t sbd_interest_rate = 0;

uint16_t sbd_print_rate = STEEMIT_100_PERCENT;
uint16_t sbd_print_rate = STEEM_100_PERCENT;

/**
* Maximum block size is decided by the set of active witnesses which change every round.
Expand Down
8 changes: 4 additions & 4 deletions libraries/chain/include/steemit/chain/util/reward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ struct comment_reward_context
asset total_reward_fund_steem;
price current_steem_price;
curve_id reward_curve = quadratic;
uint128_t content_constant = STEEMIT_CONTENT_CONSTANT_HF0;
uint128_t content_constant = STEEM_CONTENT_CONSTANT_HF0;
};

uint64_t get_rshare_reward( const comment_reward_context& ctx );

inline uint128_t get_content_constant_s()
{
return STEEMIT_CONTENT_CONSTANT_HF0; // looking good for posters
return STEEM_CONTENT_CONSTANT_HF0; // looking good for posters
}

uint128_t evaluate_reward_curve( const uint128_t& rshares, const curve_id& curve = quadratic, const uint128_t& content_constant = STEEMIT_CONTENT_CONSTANT_HF0 );
uint128_t evaluate_reward_curve( const uint128_t& rshares, const curve_id& curve = quadratic, const uint128_t& content_constant = STEEM_CONTENT_CONSTANT_HF0 );

inline bool is_comment_payout_dust( const price& p, uint64_t steem_payout )
{
return to_sbd( p, asset( steem_payout, STEEM_SYMBOL ) ) < STEEMIT_MIN_PAYOUT_SBD;
return to_sbd( p, asset( steem_payout, STEEM_SYMBOL ) ) < STEEM_MIN_PAYOUT_SBD;
}

} } } // steemit::chain::util
Expand Down
12 changes: 6 additions & 6 deletions libraries/chain/include/steemit/chain/witness_objects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace steemit { namespace chain {
version running_version;

hardfork_version hardfork_version_vote;
time_point_sec hardfork_time_vote = STEEMIT_GENESIS_TIME;
time_point_sec hardfork_time_vote = STEEM_GENESIS_TIME;
};


Expand Down Expand Up @@ -151,7 +151,7 @@ namespace steemit { namespace chain {

fc::uint128 current_virtual_time;
uint32_t next_shuffle_block_num = 1;
fc::array< account_name_type, STEEMIT_MAX_WITNESSES > current_shuffled_witnesses;
fc::array< account_name_type, STEEM_MAX_WITNESSES > current_shuffled_witnesses;
uint8_t num_scheduled_witnesses = 1;
uint8_t top19_weight = 1;
uint8_t timeshare_weight = 5;
Expand All @@ -160,10 +160,10 @@ namespace steemit { namespace chain {
chain_properties median_props;
version majority_version;

uint8_t max_voted_witnesses = STEEMIT_MAX_VOTED_WITNESSES_HF0;
uint8_t max_miner_witnesses = STEEMIT_MAX_MINER_WITNESSES_HF0;
uint8_t max_runner_witnesses = STEEMIT_MAX_RUNNER_WITNESSES_HF0;
uint8_t hardfork_required_witnesses = STEEMIT_HARDFORK_REQUIRED_WITNESSES;
uint8_t max_voted_witnesses = STEEM_MAX_VOTED_WITNESSES_HF0;
uint8_t max_miner_witnesses = STEEM_MAX_MINER_WITNESSES_HF0;
uint8_t max_runner_witnesses = STEEM_MAX_RUNNER_WITNESSES_HF0;
uint8_t hardfork_required_witnesses = STEEM_HARDFORK_REQUIRED_WITNESSES;
};


Expand Down
Loading

0 comments on commit 728685e

Please sign in to comment.