11 using Ballots = std::unordered_map<ccf::MemberId, std::string>;
12 using Votes = std::unordered_map<ccf::MemberId, bool>;
17 std::optional<std::string>
trace;
24 return !(*
this == rhs);
56 std::optional<Failure>
failure = std::nullopt;
70 std::optional<Votes>
votes = std::nullopt;
72 std::optional<Failure>
failure = std::nullopt;
86 static constexpr auto PROPOSALS =
"public:ccf.gov.proposals";
87 static constexpr auto PROPOSALS_INFO =
"public:ccf.gov.proposals_info";
115struct formatter<
std::optional<ccf::jsgov::Failure>>
117 template <
typename ParseContext>
118 constexpr auto parse(ParseContext& ctx)
123 template <
typename FormatContext>
125 const std::optional<ccf::jsgov::Failure>& f, FormatContext& ctx)
const
130 ctx.out(),
"{}\nTrace: {}", f->reason, f->trace.value_or(
"N/A"));
132 return format_to(ctx.out(),
"N/A");
#define DECLARE_JSON_REQUIRED_FIELDS(TYPE,...)
Definition json.h:718
#define DECLARE_JSON_TYPE(TYPE)
Definition json.h:667
#define DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(TYPE)
Definition json.h:694
#define DECLARE_JSON_OPTIONAL_FIELDS(TYPE,...)
Definition json.h:790
std::unordered_map< ccf::MemberId, bool > Votes
Definition gov.h:12
std::unordered_map< ccf::MemberId, Failure > VoteFailures
Definition gov.h:30
std::unordered_map< ccf::MemberId, std::string > Ballots
Definition gov.h:11
ProposalState
Definition proposals.h:19
std::string ProposalId
Definition proposals.h:40
std::string name
Definition gov.h:92
nlohmann::json args
Definition gov.h:93
std::string ballot
Definition gov.h:107
std::optional< std::string > trace
Definition gov.h:17
std::string reason
Definition gov.h:16
bool operator==(const Failure &rhs) const
Definition gov.h:18
bool operator!=(const Failure &rhs) const
Definition gov.h:22
Proposal summary constructed while executing/resolving proposal ballots.
Definition gov.h:65
std::optional< VoteFailures > vote_failures
Definition gov.h:71
std::optional< Votes > votes
Definition gov.h:70
ccf::ProposalId proposal_id
Definition gov.h:66
size_t ballot_count
Definition gov.h:69
ccf::ProposalState state
Definition gov.h:68
ccf::MemberId proposer_id
Definition gov.h:67
std::optional< Failure > failure
Definition gov.h:72
Proposal metadata stored in the KV.
Definition gov.h:34
std::optional< Votes > final_votes
Definition gov.h:48
ccf::MemberId proposer_id
ID of the member who originally created/submitted this proposal.
Definition gov.h:36
std::optional< Failure > failure
Definition gov.h:56
std::optional< VoteFailures > vote_failures
Definition gov.h:52
Ballots ballots
Definition gov.h:43
ccf::ProposalState state
Current state of this proposal (eg - open, accepted, withdrawn)
Definition gov.h:38
std::vector< Action > actions
Definition gov.h:100