Scorum
state.hpp
Go to the documentation of this file.
1 #pragma once
3 
7 
8 namespace scorum {
9 namespace app {
10 
12 
13 struct vote_state
14 {
15  std::string voter;
16  uint64_t weight = 0;
17  int64_t rshares = 0;
19  time_point_sec time;
20 };
21 
23 {
24  std::string authorperm;
25  uint64_t weight = 0;
26  int64_t rshares = 0;
28  time_point_sec time;
29 };
30 
35 {
37  {
38  }
39  extended_account(const account_object& a, const database& db)
40  : account_api_obj(a, db)
41  {
42  }
43 
44  // std::map<uint64_t, applied_operation> transfer_history; /// transfer to/from scorumpower
45  // std::map<uint64_t, applied_operation> post_history;
46  // std::map<uint64_t, applied_operation> vote_history;
47  // std::map<uint64_t, applied_operation> other_history;
48  std::set<std::string> witness_votes;
49  std::vector<std::pair<std::string, uint32_t>> tags_usage;
50 
51  optional<std::vector<std::string>> comments;
52  optional<std::vector<std::string>> recent_replies;
53 
54  uint32_t head_block_number = 0;
57  time_point_sec time;
58 };
59 
60 } // namespace app
61 } // namespace scorum
62 
63 // clang-format off
64 
65 FC_REFLECT_DERIVED(scorum::app::extended_account,
67  (witness_votes)
68  (tags_usage)
69  (comments)
70  (recent_replies)
71  (head_block_number)
72  (last_irreversible_block_num)
73  (head_block_id)
74  (time))
75 
77  (voter)
78  (weight)
79  (rshares)
80  (percent)
81  (time))
82 
84  (authorperm)
85  (weight)
86  (rshares)
87  (percent)
88  (time))
89 
90 // clang-format on
tracks the blockchain state in an extensible manner
Definition: database.hpp:52
FC_REFLECT(appender_args,(appender)(stream)) FC_REFLECT_DERIVED(file_appender_args
int16_t vote_weight_type
Definition: types.hpp:70
fc::ripemd160 block_id_type
Definition: types.hpp:63
Definition: asset.cpp:15
vote_weight_type percent
Definition: state.hpp:27
std::string authorperm
Definition: state.hpp:24
time_point_sec time
Definition: state.hpp:28
std::vector< std::pair< std::string, uint32_t > > tags_usage
Definition: state.hpp:49
extended_account(const account_object &a, const database &db)
Definition: state.hpp:39
block_id_type head_block_id
Definition: state.hpp:56
uint32_t head_block_number
blog posts for this user
Definition: state.hpp:54
optional< std::vector< std::string > > recent_replies
permlinks for this user
Definition: state.hpp:52
std::set< std::string > witness_votes
Definition: state.hpp:48
optional< std::vector< std::string > > comments
Definition: state.hpp:51
uint32_t last_irreversible_block_num
Definition: state.hpp:55
std::string voter
Definition: state.hpp:15
vote_weight_type percent
Definition: state.hpp:18
time_point_sec time
Definition: state.hpp:19