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

#include <witness.hpp>

Inheritance diagram for scorum::chain::dbs_witness:
scorum::chain::dbs_service_base< witness_service_i > scorum::chain::dbs_base scorum::chain::witness_service_i scorum::chain::base_service_i< witness_object >

Public Member Functions

 dbs_witness (dba::db_index &db, witness_schedule_service_i &, dynamic_global_property_service_i &, dba::db_accessor< chain_property_object > &)
 
const witness_objectget (const account_name_type &owner) const override
 
bool is_exists (const account_name_type &owner) const override
 
const witness_objectget_top_witness () const override
 
const witness_objectcreate_witness (const account_name_type &owner, const std::string &url, const public_key_type &block_signing_key, const chain_properties &props) override
 
const witness_objectcreate_initial_witness (const account_name_type &owner, const public_key_type &block_signing_key) override
 
void update_witness (const witness_object &witness, const std::string &url, const public_key_type &block_signing_key, const chain_properties &props) override
 
void adjust_witness_vote (const witness_object &witness, const share_type &delta) override
 
void adjust_witness_votes (const account_object &account, const share_type &delta) override
 
- Public Member Functions inherited from scorum::chain::dbs_service_base< witness_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< witness_object >
virtual ~base_service_i ()
 

Friends

class dbservice_dbs_factory
 

Additional Inherited Members

- Public Types inherited from scorum::chain::dbs_service_base< witness_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::base_service_i< witness_object >
using object_type = witness_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 54 of file witness.hpp.

Constructor & Destructor Documentation

◆ dbs_witness()

scorum::chain::dbs_witness::dbs_witness ( dba::db_index db,
witness_schedule_service_i witness_schedule_svc,
dynamic_global_property_service_i dgp_svc,
dba::db_accessor< chain_property_object > &  chain_dba 
)
explicit

Definition at line 16 of file witness.cpp.

Member Function Documentation

◆ adjust_witness_vote()

void scorum::chain::dbs_witness::adjust_witness_vote ( const witness_object witness,
const share_type delta 
)
overridevirtual

this updates the vote of a single witness as a result of a vote being added or removed

witnesses with a low number of votes could overflow the time field and end up with a scheduled time in the past

Implements scorum::chain::witness_service_i.

Definition at line 109 of file witness.cpp.

◆ adjust_witness_votes()

void scorum::chain::dbs_witness::adjust_witness_votes ( const account_object &  account,
const share_type delta 
)
overridevirtual

this is called by adjust_proxied_witness_votes when account proxy to self

Implements scorum::chain::witness_service_i.

Definition at line 98 of file witness.cpp.

◆ create_initial_witness()

const witness_object & scorum::chain::dbs_witness::create_initial_witness ( const account_name_type owner,
const public_key_type block_signing_key 
)
overridevirtual

Implements scorum::chain::witness_service_i.

Definition at line 66 of file witness.cpp.

◆ create_witness()

const witness_object & scorum::chain::dbs_witness::create_witness ( const account_name_type owner,
const std::string &  url,
const public_key_type block_signing_key,
const chain_properties props 
)
overridevirtual

Implements scorum::chain::witness_service_i.

Definition at line 48 of file witness.cpp.

◆ get()

const witness_object & scorum::chain::dbs_witness::get ( const account_name_type owner) const
overridevirtual

Implements scorum::chain::witness_service_i.

Definition at line 27 of file witness.cpp.

◆ get_top_witness()

const witness_object & scorum::chain::dbs_witness::get_top_witness ( ) const
overridevirtual

Implements scorum::chain::witness_service_i.

Definition at line 41 of file witness.cpp.

◆ is_exists()

bool scorum::chain::dbs_witness::is_exists ( const account_name_type owner) const
overridevirtual

Implements scorum::chain::witness_service_i.

Definition at line 36 of file witness.cpp.

◆ update_witness()

void scorum::chain::dbs_witness::update_witness ( const witness_object witness,
const std::string &  url,
const public_key_type block_signing_key,
const chain_properties props 
)
overridevirtual

Implements scorum::chain::witness_service_i.

Definition at line 86 of file witness.cpp.

Friends And Related Function Documentation

◆ dbservice_dbs_factory

friend class dbservice_dbs_factory
friend

Definition at line 56 of file witness.hpp.


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