Scorum
decline_voting_rights_request.cpp
Go to the documentation of this file.
5 #include <tuple>
6 
7 using namespace scorum::protocol;
8 
9 namespace scorum {
10 namespace chain {
11 
12 dbs_decline_voting_rights_request::dbs_decline_voting_rights_request(database& db)
13  : base_service_type(db)
14  , _dgp_svc(db.dynamic_global_property_service())
15 {
16 }
17 
20 {
21  try
22  {
23  return get_by<by_account>(account_id);
24  }
25  FC_CAPTURE_AND_RETHROW((account_id))
26 }
27 
29 {
30  return find_by<by_account>(account_id) != nullptr;
31 }
32 
34 dbs_decline_voting_rights_request::create_rights(const account_id_type& account, const fc::microseconds& time_to_life)
35 {
36  const auto& new_object = create([&](decline_voting_rights_request_object& req) {
37  req.account = account;
38  req.effective_date = _dgp_svc.head_block_time() + time_to_life;
39  });
40 
41  return new_object;
42 }
43 
44 } // namespace chain
45 } // namespace scorum
tracks the blockchain state in an extensible manner
Definition: database.hpp:52
const decline_voting_rights_request_object & create_rights(const account_id_type &account, const fc::microseconds &time_to_life) override
virtual const object_type & create(const modifier_type &modifier) override
Definition: asset.cpp:15
virtual fc::time_point_sec head_block_time() const =0