Scorum
scorum_objects.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
10 
11 #include <boost/multi_index/composite_key.hpp>
12 #include <boost/multiprecision/cpp_int.hpp>
13 
14 namespace scorum {
15 namespace chain {
16 
19 
20 class escrow_object : public object<escrow_object_type, escrow_object>
21 {
22 public:
23  CHAINBASE_DEFAULT_CONSTRUCTOR(escrow_object)
24 
25  id_type id;
26 
27  uint32_t escrow_id = 20;
31  time_point_sec ratification_deadline;
32  time_point_sec escrow_expiration;
35  bool to_approved = false;
36  bool agent_approved = false;
37  bool disputed = false;
38 
39  bool is_approved() const
40  {
41  return to_approved && agent_approved;
42  }
43 };
44 
46  : public object<decline_voting_rights_request_object_type, decline_voting_rights_request_object>
47 {
48 public:
49  CHAINBASE_DEFAULT_CONSTRUCTOR(decline_voting_rights_request_object)
50 
51  id_type id;
52 
54  time_point_sec effective_date;
55 };
56 
57 // clang-format off
58 
59 struct by_from_id;
60 struct by_to;
61 struct by_agent;
62 struct by_ratification_deadline;
63 typedef shared_multi_index_container<escrow_object,
64  indexed_by<ordered_unique<tag<by_id>,
66  ordered_unique<tag<by_from_id>,
67  composite_key<escrow_object,
68  member<escrow_object,
70  &escrow_object::from>,
71  member<escrow_object,
72  uint32_t,
73  &escrow_object::escrow_id>>>,
74  ordered_unique<tag<by_to>,
75  composite_key<escrow_object,
76  member<escrow_object,
78  &escrow_object::to>,
79  member<escrow_object,
81  &escrow_object::id>>>,
82  ordered_unique<tag<by_agent>,
83  composite_key<escrow_object,
84  member<escrow_object,
86  &escrow_object::agent>,
87  member<escrow_object,
89  &escrow_object::id>>>,
90  ordered_unique<tag<by_ratification_deadline>,
91  composite_key<escrow_object,
92  const_mem_fun<escrow_object,
93  bool,
94  &escrow_object::is_approved>,
95  member<escrow_object,
96  time_point_sec,
97  &escrow_object::ratification_deadline>,
98  member<escrow_object,
100  &escrow_object::id>>,
101  composite_key_compare<std::less<bool>,
102  std::less<time_point_sec>,
103  std::less<escrow_id_type>>>>
104  >
106 
107 struct by_account;
108 struct by_effective_date;
109 typedef shared_multi_index_container<decline_voting_rights_request_object,
110  indexed_by<ordered_unique<tag<by_id>,
114  ordered_unique<tag<by_account>,
118  ordered_unique<tag<by_effective_date>,
121  time_point_sec,
127  account>>,
128  composite_key_compare<std::less<time_point_sec>,
129  std::less<account_id_type>>>>
130  >
132 // clang-format on
133 
134 } // namespace chain
135 } // namespace scorum
136 
137 // clang-format off
138 
140  (id)(escrow_id)(from)(to)(agent)
141  (ratification_deadline)(escrow_expiration)
142  (scorum_balance)(pending_fee)
143  (to_approved)(agent_approved)(disputed) )
144 CHAINBASE_SET_INDEX_TYPE( scorum::chain::escrow_object, scorum::chain::escrow_index )
145 
147  (id)(account)(effective_date) )
149 
150 // clang-format on
time_point_sec ratification_deadline
#define SCORUM_SYMBOL
Definition: config.hpp:102
FC_REFLECT(appender_args,(appender)(stream)) FC_REFLECT_DERIVED(file_appender_args
shared_multi_index_container< escrow_object, indexed_by< ordered_unique< tag< by_id >, member< escrow_object, escrow_id_type, &escrow_object::id > >, ordered_unique< tag< by_from_id >, composite_key< escrow_object, member< escrow_object, account_name_type, &escrow_object::from >, member< escrow_object, uint32_t, &escrow_object::escrow_id > > >, ordered_unique< tag< by_to >, composite_key< escrow_object, member< escrow_object, account_name_type, &escrow_object::to >, member< escrow_object, escrow_id_type, &escrow_object::id > > >, ordered_unique< tag< by_agent >, composite_key< escrow_object, member< escrow_object, account_name_type, &escrow_object::agent >, member< escrow_object, escrow_id_type, &escrow_object::id > > >, ordered_unique< tag< by_ratification_deadline >, composite_key< escrow_object, const_mem_fun< escrow_object, bool, &escrow_object::is_approved >, member< escrow_object, time_point_sec, &escrow_object::ratification_deadline >, member< escrow_object, escrow_id_type, &escrow_object::id > >, composite_key_compare< std::less< bool >, std::less< time_point_sec >, std::less< escrow_id_type > > > > > escrow_index
shared_multi_index_container< decline_voting_rights_request_object, indexed_by< ordered_unique< tag< by_id >, member< decline_voting_rights_request_object, decline_voting_rights_request_id_type, &decline_voting_rights_request_object::id > >, ordered_unique< tag< by_account >, member< decline_voting_rights_request_object, account_id_type, &decline_voting_rights_request_object::account > >, ordered_unique< tag< by_effective_date >, composite_key< decline_voting_rights_request_object, member< decline_voting_rights_request_object, time_point_sec, &decline_voting_rights_request_object::effective_date >, member< decline_voting_rights_request_object, account_id_type, &decline_voting_rights_request_object::account > >, composite_key_compare< std::less< time_point_sec >, std::less< account_id_type > > > > > decline_voting_rights_request_index
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
uint64_t asset_symbol_type
Definition: asset.hpp:13
Definition: asset.cpp:15