diff --git a/examples/gno.land/p/demo/simpledao/propstore.gno b/examples/gno.land/p/demo/simpledao/propstore.gno index 972297ff0ce..06741d397cb 100644 --- a/examples/gno.land/p/demo/simpledao/propstore.gno +++ b/examples/gno.land/p/demo/simpledao/propstore.gno @@ -71,7 +71,7 @@ func (p *proposal) Render() string { output += ufmt.Sprintf("Status: %s", p.Status().String()) output += "\n\n" output += ufmt.Sprintf( - "Voting stats: YAY %d (%d%%), NAY %d (%d%%), ABSTAIN %d (%d%%), HAVEN'T VOTED %d (%d%%)", + "Voting stats: YES %d (%d%%), NO %d (%d%%), ABSTAIN %d (%d%%), MISSING VOTE %d (%d%%)", stats.YayVotes, stats.YayPercent(), stats.NayVotes, diff --git a/examples/gno.land/p/demo/simpledao/votestore.gno b/examples/gno.land/p/demo/simpledao/votestore.gno index 35a6564a1e3..908a9bb208c 100644 --- a/examples/gno.land/p/demo/simpledao/votestore.gno +++ b/examples/gno.land/p/demo/simpledao/votestore.gno @@ -2,6 +2,7 @@ package simpledao import ( "errors" + "strings" "gno.land/p/demo/avl" "gno.land/p/demo/dao" @@ -39,13 +40,15 @@ func (t *tally) castVote(member membstore.Member, option dao.VoteOption) error { } // Update the tally - switch option { + switch strings.ToUpper(option) { case dao.YesVote: t.yays += member.VotingPower case dao.AbstainVote: t.abstains += member.VotingPower - default: + case dao.NoVote: t.nays += member.VotingPower + default: + panic("invalid voting option: " + option) } // Save the voting status