-
Notifications
You must be signed in to change notification settings - Fork 1
/
tally.go
31 lines (28 loc) · 993 Bytes
/
tally.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package types
import sdk "github.com/cosmos/cosmos-sdk/types"
// TallyStats is a struct containing the stats of a tally
type TallyStats struct {
// NumVotes is the number of votes cast
NumVotes uint64
// NumMembers is the number of members who voted
NumMembers uint64
// NumGuardians is the number of guardians who voted
NumGuardians uint64
// NumEligibleMembers is the number of members who are eligible to vote
NumEligibleMembers uint64
// NumEligibleVotes is the number of votes we can include in the tally
NumEligibleVotes uint64
// TotalVotingPower is the total weight of all votes (including higher-weight individuals, called Guardians)
TotalVotingPower sdk.Dec
}
// NewEmptyTallyStats creates a new TallyStats object with all values set to zero
func NewEmptyTallyStats() TallyStats {
return TallyStats{
NumVotes: 0,
NumMembers: 0,
NumGuardians: 0,
NumEligibleMembers: 0,
NumEligibleVotes: 0,
TotalVotingPower: sdk.ZeroDec(),
}
}