Scorum
set_withdraw_scorumpower_route_evaluators.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
6 
8 
9 #include <memory>
10 
11 namespace scorum {
12 namespace chain {
13 
14 struct account_service_i;
15 struct dev_pool_service_i;
16 
17 class set_withdraw_scorumpower_route_evaluator_impl;
18 
19 struct data_service_factory_i;
20 
21 // This evaluator sets withdraw scorumpower route from account to account
22 // by operation set_withdraw_scorumpower_route_to_account_operation.
24  : public evaluator_impl<data_service_factory_i, set_withdraw_scorumpower_route_to_account_evaluator>
25 {
26 public:
28 
29  set_withdraw_scorumpower_route_to_account_evaluator(data_service_factory_i& services);
31 
32  void do_apply(const operation_type& op);
33 
34 private:
35  std::unique_ptr<set_withdraw_scorumpower_route_evaluator_impl> _impl;
36  account_service_i& _account_service;
37 };
38 
39 // This evaluator sets withdraw scorumpower route from account to development pool
40 // by operation set_withdraw_scorumpower_route_to_dev_pool_operation.
42  : public evaluator_impl<data_service_factory_i, set_withdraw_scorumpower_route_to_dev_pool_evaluator>
43 {
44 public:
46 
47  set_withdraw_scorumpower_route_to_dev_pool_evaluator(data_service_factory_i& services);
49 
50  void do_apply(const operation_type& op);
51 
52 private:
53  std::unique_ptr<set_withdraw_scorumpower_route_evaluator_impl> _impl;
54  account_service_i& _account_service;
55  dev_pool_service_i& _dev_pool_service;
56 };
57 
60 
62 {
63 public:
64  explicit set_withdraw_scorumpower_route_context(data_service_factory_i& services,
66  uint16_t percent,
67  bool auto_vest);
68 
69  data_service_factory_i& services() const
70  {
71  return _services;
72  }
73 
74  const account_name_type& account() const
75  {
76  return _account;
77  }
78 
79  uint16_t percent() const
80  {
81  return _percent;
82  }
83 
84  bool auto_vest() const
85  {
86  return _auto_vest;
87  }
88 
89 private:
90  data_service_factory_i& _services;
91  account_name_type _account;
92  uint16_t _percent;
93  bool _auto_vest;
94 };
95 
96 // This task sets withdraw scorumpower route from development pool to account
97 // withount any operation for development commitee purpose.
98 class set_withdraw_scorumpower_route_from_dev_pool_task : public task<set_withdraw_scorumpower_route_context>
99 {
100 public:
102 };
103 
104 } // namespace chain
105 } // namespace scorum
set_withdraw_scorumpower_route_context(data_service_factory_i &services, const account_name_type &account, uint16_t percent, bool auto_vest)
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
Definition: asset.cpp:15