Scorum
proposal_evaluators.cpp
Go to the documentation of this file.
2 
9 
11 
12 namespace scorum {
13 namespace chain {
14 
17 {
18 }
19 
22 {
23  auto& account_service = this->db().account_service();
24  auto& dev_pool = this->db().dev_pool_service();
25 
26  FC_ASSERT(o.amount <= dev_pool.get_scr_balace(), "Not enough SCR in dev pool.");
27 
28  dev_pool.decrease_scr_balance(o.amount);
29 
30  const auto& account = account_service.get_account(o.to_account);
31 
32  account_service.increase_balance(account, o.amount);
33 }
34 
36  data_service_factory_i& r)
38 {
39 }
40 
43 {
44  auto& hardfork_service = this->db().hardfork_property_service();
45 
46  if (hardfork_service.has_hardfork(SCORUM_HARDFORK_0_2))
47  {
48  FC_ASSERT(o.vesting_shares >= asset(0, SP_SYMBOL), "Must withdraw a non-negative amount");
49  }
50  else
51  {
52  FC_ASSERT(o.vesting_shares > asset(0, SP_SYMBOL), "Must withdraw a nonzero amount");
53  }
54 
55  withdraw_scorumpower_dev_pool_task create_withdraw;
57  create_withdraw.apply(ctx);
58 }
59 
63 {
64 }
65 
68 {
69  auto& adv_property_service = this->db().advertising_property_service();
70 
71  adv_property_service.update([&](advertising_property_object& obj) { obj.moderator = o.account; });
72 }
73 
75  data_service_factory_i& r)
77 {
78 }
79 
82 {
83  auto& service = this->db().betting_property_service();
84 
85  service.update([&](betting_property_object& obj) { obj.moderator = o.account; });
86 }
87 
91 {
92 }
93 
96 {
97  auto& service = this->db().betting_property_service();
98 
99  service.update([&](betting_property_object& obj) { obj.resolve_delay_sec = o.delay_sec; });
100 }
101 
102 template <>
105 {
106  auto& adv_property = this->db().advertising_property_service();
107 
108  adv_property.update([&](advertising_property_object& adv) {
109  adv.auction_post_coefficients.clear();
110  std::copy(std::begin(o.auction_coefficients), std::end(o.auction_coefficients),
111  std::back_inserter(adv.auction_post_coefficients));
112  });
113 }
114 
115 template <>
118 {
119  auto& adv_property = this->db().advertising_property_service();
120 
121  adv_property.update([&](advertising_property_object& adv) {
122  adv.auction_banner_coefficients.clear();
123  std::copy(std::begin(o.auction_coefficients), std::end(o.auction_coefficients),
124  std::back_inserter(adv.auction_banner_coefficients));
125  });
126 }
127 
130 
131 } // namespace chain
132 } // namespace scorum
account_name_type moderator
moderator account name
uint32_t resolve_delay_sec
resolve delay time after gam
DataServices & db() const
Definition: evaluator.hpp:34
void apply(ContextType &ctx)
Definition: tasks_base.hpp:55
#define SP_SYMBOL
Definition: config.hpp:104
Definition: asset.cpp:15