14 namespace database_ns {
22 FC_ASSERT(
false,
"Not implemented.");
31 : _account_service(account_service)
32 , _dev_pool_service(dev_pool_service)
38 const account_object& account = _account_service.
get(
id);
40 return account.scorumpower;
45 const dev_committee_object& pool = _dev_pool_service.
get();
47 FC_ASSERT(
id == pool.id);
49 return pool.sp_balance;
61 FC_ASSERT(
false,
"Not implemented.");
69 : _account_service(account_service)
70 , _dev_pool_service(dev_pool_service)
77 const account_object& from_account = _account_service.
get(
id);
84 const dev_committee_object& from_pool = _dev_pool_service.
get();
86 FC_ASSERT(
id == from_pool.id);
88 _dev_pool_service.
update([&](dev_committee_object& pool) { pool.sp_balance -= _amount; });
101 : _account_service(account_service)
102 , _dev_pool_service(dev_pool_service)
109 const account_object& to_account = _account_service.
get(to);
116 const dev_committee_object& to_pool = _dev_pool_service.
get();
118 FC_ASSERT(to == to_pool.id);
120 _dev_pool_service.
update([&](dev_committee_object& pool) { pool.scr_balance += _amount; });
126 const asset& _amount;
133 : _account_service(account_service)
134 , _dev_pool_service(dev_pool_service)
141 const account_object& to_account = _account_service.
get(
id);
148 const dev_committee_object& to_pool = _dev_pool_service.
get();
150 FC_ASSERT(
id == to_pool.id);
152 _dev_pool_service.
update([&](dev_committee_object& pool) { pool.sp_balance += _amount; });
158 const asset& _amount;
170 : _account_service(account_service)
179 const account_object& from_account = _account_service.get(_from);
180 const account_object& to_account = _account_service.get(to);
182 _emmiter.push_virtual_operation(
188 const account_object& from_account = _account_service.get(_from);
197 const asset& _amount;
206 : _account_service(account_service)
214 const account_object& to_account = _account_service.get(to);
227 const asset& _amount;
235 : _account_service(account_service)
244 _to.visit(update_statistic_from_account_visitor(_account_service, _emmiter, from, _amount));
249 _to.visit(update_statistic_from_dev_committee_visitor(_account_service, _emmiter, _amount));
256 const asset& _amount;
264 , _account_service(ctx.services().account_service())
265 , _dev_pool_service(ctx.services().dev_pool_service())
266 , _dprops_service(ctx.services().dynamic_global_property_service())
287 auto op = from.visit(
319 FC_ASSERT(amount.
amount > 0);
virtual void push_virtual_operation(const operation &op)
void operator()(const account_id_type &id) const
decrease_sp_visitor(account_service_i &account_service, dev_pool_service_i &dev_pool_service, const asset &amount)
void operator()(const dev_committee_id_type &id) const
asset operator()(const account_id_type &id) const
get_available_scorumpower_visitor(account_service_i &account_service, dev_pool_service_i &dev_pool_service)
asset operator()(const dev_committee_id_type &id) const
void operator()(const account_id_type &to) const
increase_scr_visitor(account_service_i &account_service, dev_pool_service_i &dev_pool_service, const asset &amount)
void operator()(const dev_committee_id_type &to) const
void operator()(const dev_committee_id_type &id) const
increase_sp_visitor(account_service_i &account_service, dev_pool_service_i &dev_pool_service, const asset &amount)
void operator()(const account_id_type &id) const
void operator()(const dev_committee_id_type &) const
void operator()(const account_id_type &from) const
update_statistic_visitor(account_service_i &account_service, database_virtual_operations_emmiter_i &emmiter, const withdrawable_id_type &to, const asset &amount)
void update_statistic(const withdrawable_id_type &from, const withdrawable_id_type &to, const asset &amount)
withdrawable_actors_impl(block_task_context &)
asset get_available_scorumpower(const withdrawable_id_type &from)
void decrease_sp(const withdrawable_id_type &id, const asset &amount)
void increase_sp(const withdrawable_id_type &id, const asset &amount)
void increase_scr(const withdrawable_id_type &id, const asset &amount)
fc::static_variant< account_id_type, dev_committee_id_type > withdrawable_id_type
fc::static_variant< vote_operation, comment_operation, transfer_operation, transfer_to_scorumpower_operation, withdraw_scorumpower_operation, account_create_by_committee_operation, account_create_operation, account_create_with_delegation_operation, account_update_operation, witness_update_operation, account_witness_vote_operation, account_witness_proxy_operation, delete_comment_operation, comment_options_operation, set_withdraw_scorumpower_route_to_account_operation, set_withdraw_scorumpower_route_to_dev_pool_operation, prove_authority_operation, request_account_recovery_operation, recover_account_operation, change_recovery_account_operation, escrow_approve_operation, escrow_dispute_operation, escrow_release_operation, escrow_transfer_operation, decline_voting_rights_operation, delegate_scorumpower_operation, create_budget_operation, close_budget_operation, proposal_vote_operation, proposal_create_operation, atomicswap_initiate_operation, atomicswap_redeem_operation, atomicswap_refund_operation, close_budget_by_advertising_moderator_operation, update_budget_operation, create_game_operation, cancel_game_operation, update_game_markets_operation, update_game_start_time_operation, post_game_results_operation, post_bet_operation, cancel_pending_bets_operation, delegate_sp_from_reg_pool_operation, create_nft_operation, update_nft_meta_operation, create_game_round_operation, update_game_round_result_operation, adjust_nft_experience_operation, update_nft_name_operation, author_reward_operation, comment_benefficiary_reward_operation, comment_payout_update_operation, comment_reward_operation, curation_reward_operation, hardfork_operation, producer_reward_operation, active_sp_holders_reward_operation, return_scorumpower_delegation_operation, shutdown_witness_operation, witness_miss_block_operation, expired_contract_refund_operation, acc_finished_vesting_withdraw_operation, devpool_finished_vesting_withdraw_operation, acc_to_acc_vesting_withdraw_operation, devpool_to_acc_vesting_withdraw_operation, acc_to_devpool_vesting_withdraw_operation, devpool_to_devpool_vesting_withdraw_operation, proposal_virtual_operation, budget_outgo_operation, budget_owner_income_operation, active_sp_holders_reward_legacy_operation, budget_closing_operation, bets_matched_operation, game_status_changed_operation, bet_resolved_operation, bet_cancelled_operation, bet_restored_operation, bet_updated_operation > operation
virtual void increase_balance(const account_object &account, const asset &amount)=0
virtual void increase_scorumpower(const account_object &account, const asset &amount)=0
virtual const account_object & get(const account_id_type &) const =0
virtual void decrease_scorumpower(const account_object &account, const asset &amount)=0
virtual void update(const modifier_type &modifier)=0
virtual const object_type & get() const =0
asset operator()(const Op &) const
void operator()(const Op &) const
asset_symbol_type symbol() const