forked from PBSA/peerplays
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/260-voting-info' into feature/270-funtions-unif…
…ied-form
- Loading branch information
Showing
8 changed files
with
646 additions
and
32 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
#include <graphene/chain/protocol/vote.hpp> | ||
|
||
namespace graphene { namespace chain { | ||
|
||
/** | ||
* @class voters_info_object | ||
* @ingroup object | ||
*/ | ||
struct voters_info_object { | ||
vote_id_type vote_id; | ||
vector<account_id_type> voters; | ||
}; | ||
|
||
/** | ||
* @class voters_info | ||
* @brief tracks information about a voters info | ||
* @ingroup object | ||
*/ | ||
struct voters_info { | ||
voters_info_object voters_for_committee_member; | ||
voters_info_object voters_for_witness; | ||
voters_info_object voters_for_worker; | ||
voters_info_object voters_against_worker; | ||
voters_info_object voters_for_son; | ||
}; | ||
|
||
} } // graphene::chain | ||
|
||
FC_REFLECT( graphene::chain::voters_info_object, | ||
(vote_id) | ||
(voters) ) | ||
|
||
FC_REFLECT( graphene::chain::voters_info, | ||
(voters_for_committee_member) | ||
(voters_for_witness) | ||
(voters_for_worker) | ||
(voters_against_worker) | ||
(voters_for_son) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#pragma once | ||
|
||
#include <graphene/chain/protocol/vote.hpp> | ||
|
||
namespace graphene { namespace chain { | ||
|
||
/** | ||
* @class votes_info_object | ||
* @tparam IdType id type of the object | ||
* @ingroup object | ||
*/ | ||
template<typename IdType> | ||
struct votes_info_object { | ||
votes_info_object() = default; | ||
votes_info_object(const vote_id_type& vote_id_, uint64_t id_) | ||
: vote_id{vote_id_} | ||
, id{id_} | ||
{} | ||
|
||
vote_id_type vote_id; | ||
IdType id; | ||
}; | ||
|
||
/** | ||
* @class votes_info | ||
* @brief tracks information about a votes info | ||
* @ingroup object | ||
*/ | ||
struct votes_info { | ||
vector< votes_info_object<committee_member_id_type> > votes_for_committee_members; | ||
vector< votes_info_object<witness_id_type> > votes_for_witnesses; | ||
vector< votes_info_object<worker_id_type> > votes_for_workers; | ||
vector< votes_info_object<worker_id_type> > votes_against_workers; | ||
vector< votes_info_object<son_id_type> > votes_for_sons; | ||
}; | ||
|
||
} } // graphene::chain | ||
|
||
FC_REFLECT_TEMPLATE( (typename IdType), graphene::chain::votes_info_object<IdType>, | ||
(vote_id) | ||
(id) ) | ||
|
||
FC_REFLECT( graphene::chain::votes_info, | ||
(votes_for_committee_members) | ||
(votes_for_witnesses) | ||
(votes_for_workers) | ||
(votes_against_workers) | ||
(votes_for_sons) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.