Scorum
registration_objects.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <fc/fixed_string.hpp>
4 
6 
8 
9 #include <boost/multi_index/composite_key.hpp>
10 
12 
13 #include <fc/shared_buffer.hpp>
14 
15 namespace scorum {
16 namespace chain {
17 
19 
20 class registration_pool_object : public object<registration_pool_object_type, registration_pool_object>
21 {
22 public:
23  CHAINBASE_DEFAULT_DYNAMIC_CONSTRUCTOR(registration_pool_object, (schedule_items))
24 
25  id_type id;
26 
29 
31 
33 
35  {
36  uint32_t users;
37 
38  uint16_t bonus_percent;
39  };
40 
41  fc::shared_vector<schedule_item> schedule_items;
42 
43  protocol::percent_type invite_quorum = SCORUM_COMMITTEE_ADD_EXCLUDE_QUORUM_PERCENT;
44  protocol::percent_type dropout_quorum = SCORUM_COMMITTEE_ADD_EXCLUDE_QUORUM_PERCENT;
45  protocol::percent_type change_quorum = SCORUM_COMMITTEE_QUORUM_PERCENT;
46 };
47 
49  : public object<registration_committee_member_object_type, registration_committee_member_object>
50 {
51 public:
52  CHAINBASE_DEFAULT_CONSTRUCTOR(registration_committee_member_object)
53 
54  id_type id;
55 
57 
58  // temporary schedule info
59 
61 
62  uint32_t last_allocated_block = 0;
63 
65 };
66 
67 typedef shared_multi_index_container<registration_pool_object,
68  indexed_by<ordered_unique<tag<by_id>,
73 
74 struct by_account_name;
75 
76 typedef shared_multi_index_container<registration_committee_member_object,
77  indexed_by<ordered_unique<tag<by_id>,
81  ordered_unique<tag<by_account_name>,
86 } // namespace chain
87 } // namespace scorum
88 
89 // clang-format off
91  (id)
92  (balance)
93  (delegated)
94  (maximum_bonus)
95  (already_allocated_count)
96  (schedule_items)
97  (invite_quorum)
98  (dropout_quorum)
99  (change_quorum))
100 
101 CHAINBASE_SET_INDEX_TYPE(scorum::chain::registration_pool_object, scorum::chain::registration_pool_index)
102 
104  (id)
105  (account)
109 
110 CHAINBASE_SET_INDEX_TYPE(scorum::chain::registration_committee_member_object,
112 // clang-format on
fc::shared_vector< schedule_item > schedule_items
#define SCORUM_REGISTRATION_BONUS_LIMIT_PER_MEMBER_N_BLOCK
Definition: config.hpp:166
#define SP_SYMBOL
Definition: config.hpp:104
#define SCORUM_SYMBOL
Definition: config.hpp:102
FC_REFLECT(appender_args,(appender)(stream)) FC_REFLECT_DERIVED(file_appender_args
shared_multi_index_container< registration_pool_object, indexed_by< ordered_unique< tag< by_id >, member< registration_pool_object, registration_pool_id_type, &registration_pool_object::id > > > > registration_pool_index
shared_multi_index_container< registration_committee_member_object, indexed_by< ordered_unique< tag< by_id >, member< registration_committee_member_object, registration_committee_member_id_type, &registration_committee_member_object::id > >, ordered_unique< tag< by_account_name >, member< registration_committee_member_object, account_name_type, &registration_committee_member_object::account > > > > registration_committee_member_index
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
uint16_t percent_type
Definition: types.hpp:69
Definition: asset.cpp:15