13 using Ballots = std::unordered_map<ccf::MemberId, std::string>;
14 using Votes = std::unordered_map<ccf::MemberId, bool>;
19 std::optional<std::string>
trace;
26 return !(*
this == rhs);
58 std::optional<Failure>
failure = std::nullopt;
72 std::optional<Votes>
votes = std::nullopt;
74 std::optional<Failure>
failure = std::nullopt;
88 static constexpr auto PROPOSALS =
"public:ccf.gov.proposals";
89 static constexpr auto PROPOSALS_INFO =
"public:ccf.gov.proposals_info";
118struct formatter<
std::optional<ccf::jsgov::Failure>>
120 template <
typename ParseContext>
121 constexpr auto parse(ParseContext& ctx)
126 template <
typename FormatContext>
128 const std::optional<ccf::jsgov::Failure>& f, FormatContext& ctx)
const
133 ctx.out(),
"{}\nTrace: {}", f->reason, f->trace.value_or(
"N/A"));
137 return format_to(ctx.out(),
"N/A");
#define DECLARE_JSON_REQUIRED_FIELDS(TYPE,...)
Definition json.h:714
#define DECLARE_JSON_TYPE(TYPE)
Definition json.h:663
#define DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(TYPE)
Definition json.h:690
#define DECLARE_JSON_OPTIONAL_FIELDS(TYPE,...)
Definition json.h:786
std::unordered_map< ccf::MemberId, bool > Votes
Definition gov.h:14
std::unordered_map< ccf::MemberId, Failure > VoteFailures
Definition gov.h:32
std::unordered_map< ccf::MemberId, std::string > Ballots
Definition gov.h:13
Definition app_interface.h:14
ProposalState
Definition proposals.h:19
std::string ProposalId
Definition proposals.h:40
std::string name
Definition gov.h:94
nlohmann::json args
Definition gov.h:95
std::string ballot
Definition gov.h:109
std::optional< std::string > trace
Definition gov.h:19
std::string reason
Definition gov.h:18
bool operator==(const Failure &rhs) const
Definition gov.h:20
bool operator!=(const Failure &rhs) const
Definition gov.h:24
Proposal summary constructed while executing/resolving proposal ballots.
Definition gov.h:67
std::optional< VoteFailures > vote_failures
Definition gov.h:73
std::optional< Votes > votes
Definition gov.h:72
ccf::ProposalId proposal_id
Definition gov.h:68
size_t ballot_count
Definition gov.h:71
ccf::ProposalState state
Definition gov.h:70
ccf::MemberId proposer_id
Definition gov.h:69
std::optional< Failure > failure
Definition gov.h:74
Proposal metadata stored in the KV.
Definition gov.h:36
std::optional< Votes > final_votes
Definition gov.h:50
ccf::MemberId proposer_id
ID of the member who originally created/submitted this proposal.
Definition gov.h:38
std::optional< Failure > failure
Definition gov.h:58
std::optional< VoteFailures > vote_failures
Definition gov.h:54
Ballots ballots
Definition gov.h:45
ccf::ProposalState state
Current state of this proposal (eg - open, accepted, withdrawn)
Definition gov.h:40
std::vector< Action > actions
Definition gov.h:102