Scorum
Public Member Functions | Friends | List of all members
scorum::chain::dbs_account Class Reference

#include <account.hpp>

Inheritance diagram for scorum::chain::dbs_account:
scorum::chain::dbs_service_base< account_service_i > scorum::chain::dbs_base scorum::chain::account_service_i scorum::chain::base_service_i< account_object >

Public Member Functions

 dbs_account (dba::db_index &, dynamic_global_property_service_i &, witness_service_i &)
 
virtual const account_object & get (const account_id_type &) const override
 
virtual const account_object & get_account (const account_name_type &) const override
 
virtual bool is_exists (const account_name_type &) const override
 
virtual const account_authority_object & get_account_authority (const account_name_type &) const override
 
virtual void check_account_existence (const account_name_type &, const optional< const char * > &context_type_name=optional< const char * >()) const override
 
virtual void check_account_existence (const account_authority_map &, const optional< const char * > &context_type_name=optional< const char * >()) const override
 
virtual const account_object & create_initial_account (const account_name_type &new_account_name, const public_key_type &memo_key, const asset &balance_in_scorums, const std::string &json_metadata) override
 
const account_object & create_account (const account_name_type &new_account_name, const account_name_type &creator_name, const public_key_type &memo_key, const std::string &json_metadata, const authority &owner, const authority &active, const authority &posting) override
 
virtual const account_object & create_account (const account_name_type &new_account_name, const account_name_type &creator_name, const public_key_type &memo_key, const std::string &json_metadata, const authority &owner, const authority &active, const authority &posting, const asset &fee_in_scorums) override
 
virtual const account_object & create_account_with_delegation (const account_name_type &new_account_name, const account_name_type &creator_name, const public_key_type &memo_key, const std::string &json_metadata, const authority &owner, const authority &active, const authority &posting, const asset &fee_in_scorums, const asset &delegation_in_scorumpower) override
 
virtual const account_object & create_account_with_bonus (const account_name_type &new_account_name, const account_name_type &creator_name, const public_key_type &memo_key, const std::string &json_metadata, const authority &owner, const authority &active, const authority &posting, const asset &bonus) override
 
virtual void update_acount (const account_object &account, const account_authority_object &account_authority, const public_key_type &memo_key, const std::string &json_metadata, const optional< authority > &owner, const optional< authority > &active, const optional< authority > &posting) override
 
virtual void increase_balance (const account_object &account, const asset &amount) override
 
virtual void increase_balance (account_name_type account_name, const asset &amount) override
 
virtual void decrease_balance (const account_object &account, const asset &amount) override
 
virtual void increase_pending_balance (const account_object &account, const asset &amount) override
 
virtual void decrease_pending_balance (const account_object &account, const asset &amount) override
 
virtual void increase_scorumpower (const account_object &account, const asset &amount) override
 
virtual void decrease_scorumpower (const account_object &account, const asset &amount) override
 
virtual void increase_pending_scorumpower (const account_object &account, const asset &amount) override
 
virtual void decrease_pending_scorumpower (const account_object &account, const asset &amount) override
 
virtual const asset create_scorumpower (const account_object &to_account, const asset &scorum) override
 
virtual void increase_delegated_scorumpower (const account_object &account, const asset &amount) override
 
virtual void increase_received_scorumpower (account_name_type account_name, const asset &amount) override
 
virtual void increase_received_scorumpower (const account_object &account, const asset &amount) override
 
virtual void decrease_received_scorumpower (account_name_type account_name, const asset &amount) override
 
virtual void decrease_received_scorumpower (const account_object &account, const asset &amount) override
 
virtual void drop_challenged (const account_object &account) override
 
virtual void prove_authority (const account_object &account, bool require_owner) override
 
virtual void increase_witnesses_voted_for (const account_object &account) override
 
virtual void decrease_witnesses_voted_for (const account_object &account) override
 
virtual void add_post (const account_object &author_account, const account_name_type &parent_author_name) override
 
virtual void update_voting_power (const account_object &account, uint16_t voting_power) override
 
virtual void update_active_sp_holders_cashout_time (const account_object &account) override
 
virtual void update_owner_authority (const account_object &account, const authority &owner_authority) override
 
virtual void create_account_recovery (const account_name_type &account_to_recover_name, const authority &new_owner_authority) override
 
virtual void submit_account_recovery (const account_object &account_to_recover, const authority &new_owner_authority, const authority &recent_owner_authority) override
 
virtual void change_recovery_account (const account_object &account_to_recover, const account_name_type &new_recovery_account) override
 
virtual void update_voting_proxy (const account_object &account, const optional< account_object > &proxy_account) override
 
virtual void clear_witness_votes (const account_object &account) override
 
virtual void adjust_proxied_witness_votes (const account_object &account, const std::array< share_type, SCORUM_MAX_PROXY_RECURSION_DEPTH+1 > &delta, int depth=0) override
 
virtual void adjust_proxied_witness_votes (const account_object &account, const share_type &delta, int depth=0) override
 
virtual account_refs_type get_active_sp_holders () const override
 
virtual void foreach_account (account_call_type &&) const override
 
virtual accounts_total accounts_circulating_capital () const override
 
virtual account_refs_type get_by_cashout_time (const fc::time_point_sec &until) const override
 
- Public Member Functions inherited from scorum::chain::dbs_service_base< account_service_i >
 dbs_service_base (dba::db_index &db)
 
virtual const object_typecreate (const modifier_type &modifier) override
 
virtual void update (const modifier_type &modifier) override
 
virtual void update (const object_type &o, const modifier_type &modifier) override
 
virtual void remove () override
 
virtual void remove (const object_type &o) override
 
virtual void remove_all (const std::vector< object_cref_type > &os) override
 
virtual bool is_exists () const override
 
virtual const object_typeget () const override
 
const object_typeget_by (const Key &arg) const
 
const object_typefind_by (const Key &arg) const
 
void foreach_by (Call &&call) const
 
std::vector< object_cref_typeget_range_by (LowerBounder lower, UpperBounder upper) const
 
std::vector< object_cref_typeget_filtered_range_by (LowerBounder lower, UpperBounder upper, UnaryPredicate filter) const
 
- Public Member Functions inherited from scorum::chain::dbs_base
virtual ~dbs_base ()
 
- Public Member Functions inherited from scorum::chain::base_service_i< account_object >
virtual ~base_service_i ()
 

Friends

class dbservice_dbs_factory
 

Additional Inherited Members

- Public Types inherited from scorum::chain::dbs_service_base< account_service_i >
using base_service_type = dbs_service_base
 
using modifier_type = typename service_interface::modifier_type
 
using object_type = typename service_interface::object_type
 
using object_cref_type = typename service_interface::object_cref_type
 
- Public Types inherited from scorum::chain::account_service_i
using cref_type = typename base_service_i::object_cref_type
 
using account_refs_type = std::vector< cref_type >
 
using account_call_type = typename base_service_i::call_type
 
- Public Types inherited from scorum::chain::base_service_i< account_object >
using object_type = account_object
 
using modifier_type = std::function< void(object_type &)>
 
using call_type = std::function< void(const object_type &)>
 
using object_cref_type = std::reference_wrapper< const object_type >
 
- Protected Types inherited from scorum::chain::dbs_base
typedef dbs_base _base_type
 
- Protected Member Functions inherited from scorum::chain::dbs_base
 dbs_base ()=delete
 
 dbs_base (dbs_base &&)=delete
 
 dbs_base (dba::db_index &)
 
time_point_sec head_block_time ()
 
dba::db_indexdb_impl ()
 
const dba::db_indexdb_impl () const
 

Detailed Description

Definition at line 182 of file account.hpp.

Constructor & Destructor Documentation

◆ dbs_account()

scorum::chain::dbs_account::dbs_account ( dba::db_index db,
dynamic_global_property_service_i dgp_svc,
witness_service_i witness_svc 
)
explicit

Definition at line 17 of file account.cpp.

Member Function Documentation

◆ accounts_circulating_capital()

accounts_total scorum::chain::dbs_account::accounts_circulating_capital ( ) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 697 of file account.cpp.

◆ add_post()

void scorum::chain::dbs_account::add_post ( const account_object &  author_account,
const account_name_type parent_author_name 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 426 of file account.cpp.

◆ adjust_proxied_witness_votes() [1/2]

void scorum::chain::dbs_account::adjust_proxied_witness_votes ( const account_object &  account,
const share_type delta,
int  depth = 0 
)
overridevirtual

this updates the votes for all witnesses as a result of account SP changing

nested proxies are not supported, vote will not propagate

Implements scorum::chain::account_service_i.

Definition at line 655 of file account.cpp.

◆ adjust_proxied_witness_votes() [2/2]

void scorum::chain::dbs_account::adjust_proxied_witness_votes ( const account_object &  account,
const std::array< share_type, SCORUM_MAX_PROXY_RECURSION_DEPTH+1 > &  delta,
int  depth = 0 
)
overridevirtual

this updates the votes for witnesses as a result of account voting proxy changing

nested proxies are not supported, vote will not propagate

Implements scorum::chain::account_service_i.

Definition at line 625 of file account.cpp.

◆ change_recovery_account()

void scorum::chain::dbs_account::change_recovery_account ( const account_object &  account_to_recover,
const account_name_type new_recovery_account 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 540 of file account.cpp.

◆ check_account_existence() [1/2]

void scorum::chain::dbs_account::check_account_existence ( const account_authority_map &  names,
const optional< const char * > &  context_type_name = optional<const char*>() 
) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 70 of file account.cpp.

◆ check_account_existence() [2/2]

void scorum::chain::dbs_account::check_account_existence ( const account_name_type name,
const optional< const char * > &  context_type_name = optional<const char*>() 
) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 56 of file account.cpp.

◆ clear_witness_votes()

void scorum::chain::dbs_account::clear_witness_votes ( const account_object &  account)
overridevirtual

clears all vote records for a particular account but does not update the witness vote totals. Vote totals should be updated first via a call to adjust_proxied_witness_votes( a, -a.witness_vote_weight() )

Implements scorum::chain::account_service_i.

Definition at line 611 of file account.cpp.

◆ create_account() [1/2]

const account_object & scorum::chain::dbs_account::create_account ( const account_name_type new_account_name,
const account_name_type creator_name,
const public_key_type memo_key,
const std::string &  json_metadata,
const authority owner,
const authority active,
const authority posting 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 104 of file account.cpp.

◆ create_account() [2/2]

const account_object & scorum::chain::dbs_account::create_account ( const account_name_type new_account_name,
const account_name_type creator_name,
const public_key_type memo_key,
const std::string &  json_metadata,
const authority owner,
const authority active,
const authority posting,
const asset fee_in_scorums 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 136 of file account.cpp.

◆ create_account_recovery()

void scorum::chain::dbs_account::create_account_recovery ( const account_name_type account_to_recover_name,
const authority new_owner_authority 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 468 of file account.cpp.

◆ create_account_with_bonus()

const account_object & scorum::chain::dbs_account::create_account_with_bonus ( const account_name_type new_account_name,
const account_name_type creator_name,
const public_key_type memo_key,
const std::string &  json_metadata,
const authority owner,
const authority active,
const authority posting,
const asset bonus 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 201 of file account.cpp.

◆ create_account_with_delegation()

const account_object & scorum::chain::dbs_account::create_account_with_delegation ( const account_name_type new_account_name,
const account_name_type creator_name,
const public_key_type memo_key,
const std::string &  json_metadata,
const authority owner,
const authority active,
const authority posting,
const asset fee_in_scorums,
const asset delegation_in_scorumpower 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 159 of file account.cpp.

◆ create_initial_account()

const account_object & scorum::chain::dbs_account::create_initial_account ( const account_name_type new_account_name,
const public_key_type memo_key,
const asset balance_in_scorums,
const std::string &  json_metadata 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 79 of file account.cpp.

◆ create_scorumpower()

const asset scorum::chain::dbs_account::create_scorumpower ( const account_object &  to_account,
const asset scorum 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 346 of file account.cpp.

◆ decrease_balance()

void scorum::chain::dbs_account::decrease_balance ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 297 of file account.cpp.

◆ decrease_pending_balance()

void scorum::chain::dbs_account::decrease_pending_balance ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 310 of file account.cpp.

◆ decrease_pending_scorumpower()

void scorum::chain::dbs_account::decrease_pending_scorumpower ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 341 of file account.cpp.

◆ decrease_received_scorumpower() [1/2]

void scorum::chain::dbs_account::decrease_received_scorumpower ( account_name_type  account_name,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 377 of file account.cpp.

◆ decrease_received_scorumpower() [2/2]

void scorum::chain::dbs_account::decrease_received_scorumpower ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 383 of file account.cpp.

◆ decrease_scorumpower()

void scorum::chain::dbs_account::decrease_scorumpower ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 328 of file account.cpp.

◆ decrease_witnesses_voted_for()

void scorum::chain::dbs_account::decrease_witnesses_voted_for ( const account_object &  account)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 421 of file account.cpp.

◆ drop_challenged()

void scorum::chain::dbs_account::drop_challenged ( const account_object &  account)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 388 of file account.cpp.

◆ foreach_account()

void scorum::chain::dbs_account::foreach_account ( account_call_type &&  call) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 683 of file account.cpp.

◆ get()

const account_object & scorum::chain::dbs_account::get ( const account_id_type account_id) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 24 of file account.cpp.

◆ get_account()

const account_object & scorum::chain::dbs_account::get_account ( const account_name_type name) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 33 of file account.cpp.

◆ get_account_authority()

const account_authority_object & scorum::chain::dbs_account::get_account_authority ( const account_name_type name) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 47 of file account.cpp.

◆ get_active_sp_holders()

dbs_account::account_refs_type scorum::chain::dbs_account::get_active_sp_holders ( ) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 675 of file account.cpp.

◆ get_by_cashout_time()

dbs_account::account_refs_type scorum::chain::dbs_account::get_by_cashout_time ( const fc::time_point_sec &  until) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 687 of file account.cpp.

◆ increase_balance() [1/2]

void scorum::chain::dbs_account::increase_balance ( account_name_type  account_name,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 291 of file account.cpp.

◆ increase_balance() [2/2]

void scorum::chain::dbs_account::increase_balance ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 279 of file account.cpp.

◆ increase_delegated_scorumpower()

void scorum::chain::dbs_account::increase_delegated_scorumpower ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 359 of file account.cpp.

◆ increase_pending_balance()

void scorum::chain::dbs_account::increase_pending_balance ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 302 of file account.cpp.

◆ increase_pending_scorumpower()

void scorum::chain::dbs_account::increase_pending_scorumpower ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 333 of file account.cpp.

◆ increase_received_scorumpower() [1/2]

void scorum::chain::dbs_account::increase_received_scorumpower ( account_name_type  account_name,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 365 of file account.cpp.

◆ increase_received_scorumpower() [2/2]

void scorum::chain::dbs_account::increase_received_scorumpower ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 371 of file account.cpp.

◆ increase_scorumpower()

void scorum::chain::dbs_account::increase_scorumpower ( const account_object &  account,
const asset amount 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 315 of file account.cpp.

◆ increase_witnesses_voted_for()

void scorum::chain::dbs_account::increase_witnesses_voted_for ( const account_object &  account)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 416 of file account.cpp.

◆ is_exists()

bool scorum::chain::dbs_account::is_exists ( const account_name_type name) const
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 42 of file account.cpp.

◆ prove_authority()

void scorum::chain::dbs_account::prove_authority ( const account_object &  account,
bool  require_owner 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 401 of file account.cpp.

◆ submit_account_recovery()

void scorum::chain::dbs_account::submit_account_recovery ( const account_object &  account_to_recover,
const authority new_owner_authority,
const authority recent_owner_authority 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 507 of file account.cpp.

◆ update_acount()

void scorum::chain::dbs_account::update_acount ( const account_object &  account,
const account_authority_object &  account_authority,
const public_key_type memo_key,
const std::string &  json_metadata,
const optional< authority > &  owner,
const optional< authority > &  active,
const optional< authority > &  posting 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 223 of file account.cpp.

◆ update_active_sp_holders_cashout_time()

void scorum::chain::dbs_account::update_active_sp_holders_cashout_time ( const account_object &  account)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 457 of file account.cpp.

◆ update_owner_authority()

void scorum::chain::dbs_account::update_owner_authority ( const account_object &  account,
const authority owner_authority 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 262 of file account.cpp.

◆ update_voting_power()

void scorum::chain::dbs_account::update_voting_power ( const account_object &  account,
uint16_t  voting_power 
)
overridevirtual

Implements scorum::chain::account_service_i.

Definition at line 439 of file account.cpp.

◆ update_voting_proxy()

void scorum::chain::dbs_account::update_voting_proxy ( const account_object &  account,
const optional< account_object > &  proxy_account 
)
overridevirtual

remove all current votes

check for proxy loops and fail to update the proxy if it would create a loop

clear all individual vote records

add all new votes

we are clearing the proxy which means we simply update the account

Implements scorum::chain::account_service_i.

Definition at line 570 of file account.cpp.

Friends And Related Function Documentation

◆ dbservice_dbs_factory

friend class dbservice_dbs_factory
friend

Definition at line 184 of file account.hpp.


The documentation for this class was generated from the following files: