From 5ccfb9c6f0f6d355e33f2cbdee1b5718931220cc Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Tue, 30 Jul 2019 16:04:04 -0700 Subject: [PATCH] Cleanup implementation #2705 --- .../steem/plugins/rc/rc_operations.hpp | 78 +------------------ libraries/plugins/rc/rc_operations.cpp | 34 -------- libraries/plugins/rc/rc_plugin.cpp | 2 - 3 files changed, 1 insertion(+), 113 deletions(-) diff --git a/libraries/plugins/rc/include/steem/plugins/rc/rc_operations.hpp b/libraries/plugins/rc/include/steem/plugins/rc/rc_operations.hpp index 58f14646b2..65afa1c861 100644 --- a/libraries/plugins/rc/include/steem/plugins/rc/rc_operations.hpp +++ b/libraries/plugins/rc/include/steem/plugins/rc/rc_operations.hpp @@ -34,71 +34,11 @@ struct delegate_to_pool_operation : steem::protocol::base_operation void get_required_active_authorities( flat_set& a )const { a.insert( from_account ); } }; -/** - * Delegate SP or a vesting SMT from a pool to a user. - * - * What is actually delegated are DRC (delegated RC). The from_pool account is allowed to "freely print" - * DRC from its own pool. This is equal to the RC that pool user is allowed to consume. - * Pools may be over-subscribed (i.e. total DRC output is greater than RC input). - * - * Executing this operation effectively _replaces_ the effect of the previous - * `delegate_drc_from_pool_operation` with the same `(to_account, to_slot)` pair. - * - * When deciding whether the affected manabar sections are full or empty, - * the decision is always made in favor of `to_account`: - * - * - When increasing delegation, new DRC is always created to fill the new manabar section. - * - When removing delegation, DRC may be destroyed, but only to the extent necessary for the account not to exceed its newly reduced maximum. - */ -/* -struct delegate_drc_from_pool_operation : steem::protocol::base_operation -{ - account_name_type from_pool; - account_name_type to_account; - int8_t to_slot = 0; - asset_symbol_type asset_symbol; - int64_t drc_max_mana = 0; - - extensions_type extensions; - - void validate()const; - void get_required_active_authorities( flat_set& a )const { a.insert( from_pool ); } -}; -*/ - -/** - * The purpose of set_slot_delegator_operation is to set the delegator allowed to delegate to a - * `(to_account, to_slot)` pair. - * - * To delegate to a slot, from_pool must be considered the delegator of the slot. Normally the delegator is - * the account creator. The set_slot_delegator_operation allows a new delegator to be appointed by either - * the existing delegator, the account itself, or (in the case of slot 1, STEEM_RC_RECOVERY_SLOT_NUM) - * the slot may also be set by the account's recovery partner. - */ -/* -struct set_slot_delegator_operation : steem::protocol::base_operation -{ - account_name_type from_pool; - account_name_type to_account; - int8_t to_slot = 0; - account_name_type signer; - - extensions_type extensions; - - void validate()const; - void get_required_active_authorities( flat_set& a )const { a.insert( signer ); } -}; -*/ - typedef fc::static_variant< delegate_to_pool_operation - //delegate_drc_from_pool_operation, - //set_slot_delegator_operation > rc_plugin_operation; STEEM_DEFINE_PLUGIN_EVALUATOR( rc_plugin, rc_plugin_operation, delegate_to_pool ); -//STEEM_DEFINE_PLUGIN_EVALUATOR( rc_plugin, rc_plugin_operation, delegate_drc_from_pool ); -//STEEM_DEFINE_PLUGIN_EVALUATOR( rc_plugin, rc_plugin_operation, set_slot_delegator ); } } } // steem::plugins::rc @@ -108,22 +48,6 @@ FC_REFLECT( steem::plugins::rc::delegate_to_pool_operation, (amount) (extensions) ) -/* -FC_REFLECT( steem::plugins::rc::delegate_drc_from_pool_operation, - (from_pool) - (to_account) - (to_slot) - (asset_symbol) - (drc_max_mana) - (extensions) - ) -FC_REFLECT( steem::plugins::rc::set_slot_delegator_operation, - (from_pool) - (to_account) - (to_slot) - (signer) - (extensions) - ) -*/ + STEEM_DECLARE_OPERATION_TYPE( steem::plugins::rc::rc_plugin_operation ) FC_REFLECT_TYPENAME( steem::plugins::rc::rc_plugin_operation ) diff --git a/libraries/plugins/rc/rc_operations.cpp b/libraries/plugins/rc/rc_operations.cpp index cc287006f1..7e6ef7a88a 100644 --- a/libraries/plugins/rc/rc_operations.cpp +++ b/libraries/plugins/rc/rc_operations.cpp @@ -25,29 +25,6 @@ void delegate_to_pool_operation::validate()const FC_ASSERT( amount.symbol == VESTS_SYMBOL, "Currently can only delegate VESTS (SMT's not supported #2698)" ); FC_ASSERT( amount.amount.value >= 0, "Delegation to pool cannot be negative" ); } -/* -void delegate_drc_from_pool_operation::validate()const -{ - validate_account_name( from_pool ); - validate_account_name( to_account ); - - FC_ASSERT( to_slot >= 0 ); - FC_ASSERT( to_slot < STEEM_RC_MAX_OUTDEL_SLOTS ); - FC_ASSERT( asset_symbol.is_vesting(), "Must use vesting symbol" ); - FC_ASSERT( asset_symbol == VESTS_SYMBOL, "Currently can only delegate VESTS (SMT's not supported #2698)" ); - FC_ASSERT( drc_max_mana >= 0 ); -} - -void set_slot_delegator_operation::validate()const -{ - validate_account_name( from_pool ); - validate_account_name( to_account ); - validate_account_name( signer ); - - FC_ASSERT( to_slot >= 0 ); - FC_ASSERT( to_slot < STEEM_RC_MAX_OUTDEL_SLOTS ); -} -*/ void delegate_to_pool_evaluator::do_apply( const delegate_to_pool_operation& op ) { @@ -167,17 +144,6 @@ void delegate_to_pool_evaluator::do_apply( const delegate_to_pool_operation& op } } ); } -/* -void delegate_drc_from_pool_evaluator::do_apply( const delegate_drc_from_pool_operation& op ) -{ - FC_ASSERT( false, "Operation not yet supported" ); -} - -void set_slot_delegator_evaluator::do_apply( const set_slot_delegator_operation& op ) -{ - FC_ASSERT( false, "Operation not yet supported" ); -} -*/ } } } // steem::plugins::rc diff --git a/libraries/plugins/rc/rc_plugin.cpp b/libraries/plugins/rc/rc_plugin.cpp index 21e8d467ca..2c8e00c67b 100644 --- a/libraries/plugins/rc/rc_plugin.cpp +++ b/libraries/plugins/rc/rc_plugin.cpp @@ -1383,8 +1383,6 @@ void rc_plugin::plugin_initialize( const boost::program_options::variables_map& // Add each operation evaluator to the registry my->_custom_operation_interpreter->register_evaluator< delegate_to_pool_evaluator >( this ); - //my->_custom_operation_interpreter->register_evaluator< delegate_drc_from_pool_evaluator >( this ); - //my->_custom_operation_interpreter->register_evaluator< set_slot_delegator_evaluator >( this ); // Add the registry to the database so the database can delegate custom ops to the plugin my->_db.register_custom_operation_interpreter( my->_custom_operation_interpreter );