Skip to content

Commit

Permalink
Merge pull request #3049 from steemit/3029-delete-bandwidth
Browse files Browse the repository at this point in the history
Delete bandwidth
  • Loading branch information
Michael Vandeberg committed Oct 10, 2018
2 parents 939dacd + ab93289 commit 69c94e4
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 762 deletions.
1 change: 0 additions & 1 deletion libraries/plugins/apis/condenser_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ target_link_libraries( condenser_api_plugin
market_history_api_plugin
network_broadcast_api_plugin
tags_api_plugin
witness_api_plugin
steem_utilities )
target_include_directories( condenser_api_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )

Expand Down
48 changes: 0 additions & 48 deletions libraries/plugins/apis/condenser_api/condenser_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <steem/plugins/follow_api/follow_api_plugin.hpp>
#include <steem/plugins/reputation_api/reputation_api_plugin.hpp>
#include <steem/plugins/market_history_api/market_history_api_plugin.hpp>
#include <steem/plugins/witness_api/witness_api_plugin.hpp>

#include <steem/utilities/git_revision.hpp>

Expand Down Expand Up @@ -74,7 +73,6 @@ namespace detail
(get_recovery_request)
(get_escrow)
(get_withdraw_routes)
(get_account_bandwidth)
(get_savings_withdraw_from)
(get_savings_withdraw_to)
(get_vesting_delegations)
Expand Down Expand Up @@ -155,7 +153,6 @@ namespace detail
std::shared_ptr< follow::follow_api > _follow_api;
std::shared_ptr< reputation::reputation_api > _reputation_api;
std::shared_ptr< market_history::market_history_api > _market_history_api;
std::shared_ptr< witness::witness_api > _witness_api;
map< transaction_id_type, confirmation_callback > _callbacks;
map< time_point_sec, vector< transaction_id_type > > _callback_expirations;
Expand Down Expand Up @@ -785,13 +782,6 @@ namespace detail
{
CHECK_ARG_SIZE( 0 )
get_dynamic_global_properties_return gpo = _database_api->get_dynamic_global_properties( {} );
if( _witness_api )
{
auto reserve_ratio = _witness_api->get_reserve_ratio( {} );
gpo.average_block_size = reserve_ratio.average_block_size;
gpo.current_reserve_ratio = reserve_ratio.current_reserve_ratio;
gpo.max_virtual_bandwidth = reserve_ratio.max_virtual_bandwidth;
}
return gpo;
}
Expand Down Expand Up @@ -881,26 +871,6 @@ namespace detail
results.back().reputation = _reputation_api->get_account_reputations( { itr->name, 1 } ).reputations[0].reputation;
}
if( _witness_api )
{
auto& e_acct = results.back();
auto forum_bandwidth = _witness_api->get_account_bandwidth( { itr->name, witness::bandwidth_type::forum } );
if( forum_bandwidth.bandwidth.valid() )
{
e_acct.average_bandwidth = forum_bandwidth.bandwidth->average_bandwidth;
e_acct.lifetime_bandwidth = forum_bandwidth.bandwidth->lifetime_bandwidth;
e_acct.last_bandwidth_update = forum_bandwidth.bandwidth->last_bandwidth_update;
}
auto market_bandwidth = _witness_api->get_account_bandwidth( { itr->name, witness::bandwidth_type::market } );
if( market_bandwidth.bandwidth.valid() )
{
e_acct.average_market_bandwidth = market_bandwidth.bandwidth->average_bandwidth;
e_acct.lifetime_market_bandwidth = market_bandwidth.bandwidth->lifetime_bandwidth;
e_acct.last_market_bandwidth_update = market_bandwidth.bandwidth->last_bandwidth_update;
}
}
auto vitr = vidx.lower_bound( boost::make_tuple( itr->name, account_name_type() ) );
while( vitr != vidx.end() && vitr->account == itr->name ) {
results.back().witness_votes.insert( _db.get< witness_object, by_name >( vitr->witness ).owner );
Expand Down Expand Up @@ -1028,17 +998,6 @@ namespace detail
return result;
}
DEFINE_API_IMPL( condenser_api_impl, get_account_bandwidth )
{
CHECK_ARG_SIZE( 2 )
FC_ASSERT( _witness_api, "witness_api_plugin not enabled." );
return _witness_api->get_account_bandwidth(
{
args[0].as< string >(),
args[1].as< witness::bandwidth_type >()
}).bandwidth;
}
DEFINE_API_IMPL( condenser_api_impl, get_savings_withdraw_from )
{
CHECK_ARG_SIZE( 1 )
Expand Down Expand Up @@ -2202,12 +2161,6 @@ void condenser_api::api_startup()
{
my->_market_history_api = market_history->api;
}
auto witness = appbase::app().find_plugin< witness::witness_api_plugin >();
if( witness != nullptr )
{
my->_witness_api = witness->api;
}
}
DEFINE_LOCKLESS_APIS( condenser_api,
Expand Down Expand Up @@ -2244,7 +2197,6 @@ DEFINE_READ_APIS( condenser_api,
(get_recovery_request)
(get_escrow)
(get_withdraw_routes)
(get_account_bandwidth)
(get_savings_withdraw_from)
(get_savings_withdraw_to)
(get_vesting_delegations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <steem/plugins/follow_api/follow_api.hpp>
#include <steem/plugins/reputation_api/reputation_api.hpp>
#include <steem/plugins/market_history_api/market_history_api.hpp>
#include <steem/plugins/witness_api/witness_api.hpp>

#include <steem/plugins/condenser_api/condenser_api_legacy_objects.hpp>

Expand Down Expand Up @@ -233,13 +232,6 @@ struct extended_account : public api_account_object
extended_account( const database_api::api_account_object& a ) :
api_account_object( a ) {}

share_type average_bandwidth;
share_type lifetime_bandwidth;
time_point_sec last_bandwidth_update;
share_type average_market_bandwidth;
share_type lifetime_market_bandwidth;
time_point_sec last_market_bandwidth_update;

legacy_asset vesting_balance; /// convert vesting_shares to vesting steem
share_type reputation = 0;
map< uint64_t, api_operation_object > transfer_history; /// transfer to/from vesting
Expand Down Expand Up @@ -425,10 +417,6 @@ struct extended_dynamic_global_properties

uint16_t sbd_stop_percent = 0;
uint16_t sbd_start_percent = 0;

int32_t average_block_size = 0;
int64_t current_reserve_ratio = 1;
uint128_t max_virtual_bandwidth = 0;
};

struct api_witness_object
Expand Down Expand Up @@ -969,7 +957,6 @@ DEFINE_API_ARGS( get_owner_history, vector< variant >, ve
DEFINE_API_ARGS( get_recovery_request, vector< variant >, optional< database_api::api_account_recovery_request_object > )
DEFINE_API_ARGS( get_escrow, vector< variant >, optional< api_escrow_object > )
DEFINE_API_ARGS( get_withdraw_routes, vector< variant >, vector< database_api::api_withdraw_vesting_route_object > )
DEFINE_API_ARGS( get_account_bandwidth, vector< variant >, optional< witness::api_account_bandwidth_object > )
DEFINE_API_ARGS( get_savings_withdraw_from, vector< variant >, vector< api_savings_withdraw_object > )
DEFINE_API_ARGS( get_savings_withdraw_to, vector< variant >, vector< api_savings_withdraw_object > )
DEFINE_API_ARGS( get_vesting_delegations, vector< variant >, vector< api_vesting_delegation_object > )
Expand Down Expand Up @@ -1063,7 +1050,6 @@ class condenser_api
(get_recovery_request)
(get_escrow)
(get_withdraw_routes)
(get_account_bandwidth)
(get_savings_withdraw_from)
(get_savings_withdraw_to)
(get_vesting_delegations)
Expand Down Expand Up @@ -1167,7 +1153,6 @@ FC_REFLECT( steem::plugins::condenser_api::api_account_object,
)

FC_REFLECT_DERIVED( steem::plugins::condenser_api::extended_account, (steem::plugins::condenser_api::api_account_object),
(average_bandwidth)(lifetime_bandwidth)(last_bandwidth_update)(average_market_bandwidth)(lifetime_market_bandwidth)(last_market_bandwidth_update)
(vesting_balance)(reputation)(transfer_history)(market_history)(post_history)(vote_history)(other_history)(witness_votes)(tags_usage)(guest_bloggers)(open_orders)(comments)(feed)(blog)(recent_replies)(recommended) )

FC_REFLECT( steem::plugins::condenser_api::api_comment_object,
Expand All @@ -1191,8 +1176,7 @@ FC_REFLECT( steem::plugins::condenser_api::extended_dynamic_global_properties,
(total_reward_fund_steem)(total_reward_shares2)(pending_rewarded_vesting_shares)(pending_rewarded_vesting_steem)
(sbd_interest_rate)(sbd_print_rate)
(maximum_block_size)(current_aslot)(recent_slots_filled)(participation_count)(last_irreversible_block_num)(vote_power_reserve_rate)
(delegation_return_period)(reverse_auction_seconds)(sbd_stop_percent)(sbd_start_percent)
(average_block_size)(current_reserve_ratio)(max_virtual_bandwidth) )
(delegation_return_period)(reverse_auction_seconds)(sbd_stop_percent)(sbd_start_percent) )

FC_REFLECT( steem::plugins::condenser_api::api_witness_object,
(id)
Expand Down
23 changes: 0 additions & 23 deletions libraries/plugins/apis/witness_api/CMakeLists.txt

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions libraries/plugins/apis/witness_api/plugin.json

This file was deleted.

51 changes: 0 additions & 51 deletions libraries/plugins/apis/witness_api/witness_api.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions libraries/plugins/apis/witness_api/witness_api_plugin.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion libraries/plugins/witness/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_library( witness_plugin
${HEADERS}
)

target_link_libraries( witness_plugin p2p_plugin chain_plugin rc_plugin block_data_export_plugin appbase steem_chain steem_utilities steem_utilities )
target_link_libraries( witness_plugin p2p_plugin chain_plugin rc_plugin appbase steem_chain steem_utilities steem_utilities )
target_include_directories( witness_plugin
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )

Expand Down
Loading

0 comments on commit 69c94e4

Please sign in to comment.