diff --git a/libraries/chain/db_balance.cpp b/libraries/chain/db_balance.cpp index 52cf97df..1afd906b 100644 --- a/libraries/chain/db_balance.cpp +++ b/libraries/chain/db_balance.cpp @@ -72,21 +72,6 @@ void database::adjust_balance(account_id_type account, asset delta ) } FC_CAPTURE_AND_RETHROW( (account)(delta) ) } -void database::adjust_balance(const account_object& account, asset delta ) -{ - adjust_balance( account.id, delta); -} - -void database::adjust_core_in_orders( const account_object& acnt, asset delta ) -{ - if( delta.asset_id == asset_id_type(0) && delta.amount != 0 ) - { - modify( acnt.statistics(*this), [&](account_statistics_object& stat){ - stat.total_core_in_orders += delta.amount; - }); - } -} - optional< vesting_balance_id_type > database::deposit_lazy_vesting( const optional< vesting_balance_id_type >& ovbid, share_type amount, uint32_t req_vesting_seconds, diff --git a/libraries/chain/include/graphene/chain/database.hpp b/libraries/chain/include/graphene/chain/database.hpp index cb68f9f0..9e29fca3 100644 --- a/libraries/chain/include/graphene/chain/database.hpp +++ b/libraries/chain/include/graphene/chain/database.hpp @@ -322,13 +322,6 @@ namespace graphene { namespace chain { * @param delta Asset ID and amount to adjust balance by */ void adjust_balance(account_id_type account, asset delta); - /// This is an overloaded method. - void adjust_balance(const account_object& account, asset delta); - - /** - * If delta.asset_id is a core asset, adjusts account statistics - */ - void adjust_core_in_orders( const account_object& acnt, asset delta ); /** * @brief Helper to make lazy deposit to CDD VBO. diff --git a/libraries/chain/protocol/operations.cpp b/libraries/chain/protocol/operations.cpp index 9743b686..0c5a9cc0 100644 --- a/libraries/chain/protocol/operations.cpp +++ b/libraries/chain/protocol/operations.cpp @@ -19,7 +19,6 @@ namespace graphene { namespace chain { - uint64_t base_operation::calculate_data_fee( uint64_t bytes, uint64_t price_per_kbyte ) { auto result = (fc::uint128(bytes) * price_per_kbyte) / 1024; @@ -27,10 +26,7 @@ uint64_t base_operation::calculate_data_fee( uint64_t bytes, uint64_t price_per_ return result.to_uint64(); } - - - -void balance_claim_operation::validate()const +void balance_claim_operation::validate()const { FC_ASSERT( fee == asset() ); FC_ASSERT( balance_owner_key != public_key_type() ); @@ -54,88 +50,9 @@ struct required_auth_visitor } }; -struct required_active_visitor -{ - typedef void result_type; - - flat_set& result; - - required_active_visitor( flat_set& r ):result(r){} - - /** for most operations this is just the fee payer */ - template - void operator()(const T& o)const - { - result.insert( o.fee_payer() ); - } - void operator()(const account_update_operation& o)const - { - /// if owner authority is required, no active authority is required - if( !(o.owner || o.active) ) - result.insert( o.fee_payer() ); - } - void operator()( const proposal_delete_operation& o )const - { - if( !o.using_owner_authority ) - result.insert( o.fee_payer() ); - } - - void operator()( const proposal_update_operation& o )const - { - result.insert( o.fee_payer() ); - for( auto id : o.active_approvals_to_add ) - result.insert(id); - for( auto id : o.active_approvals_to_remove ) - result.insert(id); - } - void operator()( const custom_operation& o )const - { - result.insert( o.required_auths.begin(), o.required_auths.end() ); - } - void operator()( const assert_operation& o )const - { - result.insert( o.fee_payer() ); - result.insert( o.required_auths.begin(), o.required_auths.end() ); - } -}; - -struct required_owner_visitor -{ - typedef void result_type; - - flat_set& result; - - required_owner_visitor( flat_set& r ):result(r){} - - /** for most operations this is a no-op */ - template - void operator()(const T& o)const {} - - void operator()(const account_update_operation& o)const - { - if( o.owner || o.active ) - result.insert( o.account ); - } - - void operator()( const proposal_delete_operation& o )const - { - if( o.using_owner_authority ) - result.insert( o.fee_payer() ); - } - - void operator()( const proposal_update_operation& o )const - { - for( auto id : o.owner_approvals_to_add ) - result.insert(id); - for( auto id : o.owner_approvals_to_remove ) - result.insert(id); - } -}; - - struct get_impacted_account_visitor { - flat_set& _impacted; + flat_set& _impacted; get_impacted_account_visitor( flat_set& impact ):_impacted(impact) {} typedef void result_type; @@ -145,6 +62,7 @@ struct get_impacted_account_visitor o.get_impacted_accounts( _impacted ); } }; + void operation_get_impacted_accounts( const operation& op, flat_set& result ) { op.visit( get_impacted_account_visitor( result ) ); @@ -154,14 +72,6 @@ void operation_get_required_authorities( const operation& op, vector& { op.visit( required_auth_visitor( result ) ); } -void operation_get_required_active_authorities( const operation& op, flat_set& result ) -{ - op.visit( required_active_visitor( result ) ); -} -void operation_get_required_owner_authorities( const operation& op, flat_set& result ) -{ - op.visit( required_owner_visitor( result ) ); -} /** * @brief Used to validate operations in a polymorphic manner