Documentation ¶
Index ¶
Constants ¶
View Source
const (
// MaxQuestions is the maximum number of questions allowed in a VotePackage
MaxQuestions = 64
)
Variables ¶
This section is empty.
Functions ¶
func NewEmptyVotes ¶
func NewEmptyVotes(voteOpts *models.ProcessVoteOptions) [][]*types.BigInt
NewEmptyVotes creates a new results struct with the given number of questions and options
func ResultsToProto ¶ added in v1.8.0
func ResultsToProto(results *Results) *models.ProcessResult
ResultsToProto takes the Results type and builds the protobuf type ProcessResult.
Types ¶
type Results ¶
type Results struct { ProcessID types.HexBytes `json:"processId"` Votes [][]*types.BigInt `json:"votes"` Weight *types.BigInt `json:"weight"` EnvelopeType *models.EnvelopeType `json:"envelopeType"` VoteOpts *models.ProcessVoteOptions `json:"voteOptions"` BlockHeight uint32 `json:"blockHeight"` }
Results holds the final results and relevant process info for a vochain process
func ComputeResults ¶ added in v1.8.0
ComputeResults walks through the envelopes of a process and computes the results.
func ProtoToResults ¶ added in v1.8.0
func ProtoToResults(pr *models.ProcessResult) *Results
ProtoToResults takes the protobuf type ProcessResult and builds the Results type.
func (*Results) Add ¶
Add adds the total weight and votes from the given Results to the containing Results making the method call.
func (*Results) AddVote ¶
AddVote adds the voteValues and weight to the Results struct. Checks are performed according the Ballot Protocol.
Click to show internal directories.
Click to hide internal directories.