func CreatePoll Action 1func CreatePoll(creator, question string, options []string, durationBlocks int64, oneVoteOnly bool) string Copy source
type Booth struct 1type Booth struct { 2 admin string 3 polls map[string]*Poll 4 nextSeq int64 5 currentHeight int64 6} Copy source Methods on Booth func ClosePoll method on Booth 1func (b *Booth) ClosePoll(caller, pollID string) bool Copy source func CreatePoll method on Booth 1func (b *Booth) CreatePoll(creator, question string, options []string, durationBlocks int64, oneVoteOnly bool) (string, bool) Copy source func GetPoll method on Booth 1func (b *Booth) GetPoll(id string) (*Poll, bool) Copy source func Tick method on Booth 1func (b *Booth) Tick(height int64) Copy source func Vote method on Booth 1func (b *Booth) Vote(voter, pollID string, optionIdx int) bool Copy source func Winner method on Booth 1func (b *Booth) Winner(pollID string) (string, bool) Copy source
func CreatePoll method on Booth 1func (b *Booth) CreatePoll(creator, question string, options []string, durationBlocks int64, oneVoteOnly bool) (string, bool) Copy source
func Vote method on Booth 1func (b *Booth) Vote(voter, pollID string, optionIdx int) bool Copy source
type Poll struct 1type Poll struct { 2 ID string 3 Creator string 4 Question string 5 Options []string 6 Tally []int64 7 EndHeight int64 8 Status PollStatus 9 OneVoteOnly bool 10 voted map[string]int // voter -> option index (for revote tracking) 11 hasVoted map[string]bool 12} Copy source