Scorum
scorumpower_delegation.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace scorum {
7 namespace chain {
8 
9 class scorumpower_delegation_object;
10 class scorumpower_delegation_expiration_object;
11 
12 struct scorumpower_delegation_service_i : public base_service_i<scorumpower_delegation_object>
13 {
16 
17  virtual const scorumpower_delegation_object& get(const account_name_type& delegator,
18  const account_name_type& delegatee) const = 0;
19 
20  virtual bool is_exists(const account_name_type& delegator, const account_name_type& delegatee) const = 0;
21 
22  virtual const scorumpower_delegation_expiration_object&
23  create_expiration(const account_name_type& delegator, const asset& scorumpower, const time_point_sec& expiration)
24  = 0;
25 };
26 
27 class dbs_scorumpower_delegation : public dbs_service_base<scorumpower_delegation_service_i>
28 {
29  friend class dbservice_dbs_factory;
30 
31 protected:
33 
34 public:
37 
38  const scorumpower_delegation_object& get(const account_name_type& delegator,
39  const account_name_type& delegatee) const override;
40 
41  bool is_exists(const account_name_type& delegator, const account_name_type& delegatee) const override;
42 
43  const scorumpower_delegation_expiration_object& create_expiration(const account_name_type& delegator,
44  const asset& scorumpower,
45  const time_point_sec& expiration) override;
46 };
47 } // namespace chain
48 } // namespace scorum
tracks the blockchain state in an extensible manner
Definition: database.hpp:52
const scorumpower_delegation_expiration_object & create_expiration(const account_name_type &delegator, const asset &scorumpower, const time_point_sec &expiration) override
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
Definition: asset.cpp:15
virtual const scorumpower_delegation_expiration_object & create_expiration(const account_name_type &delegator, const asset &scorumpower, const time_point_sec &expiration)=0
virtual bool is_exists(const account_name_type &delegator, const account_name_type &delegatee) const =0
virtual const scorumpower_delegation_object & get(const account_name_type &delegator, const account_name_type &delegatee) const =0