func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes types.Votes) {
	keeper.IterateVotes(ctx, proposalID, func(vote types.Vote) bool {
		votes = append(votes, vote)
		return false
	})
	return
}
GetVotes returns all the votes from a proposal
package keeper
import (
	"fmt"
	"github.com/KuChainNetwork/kuchain/x/gov/types"
	sdk "github.com/cosmos/cosmos-sdk/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr AccountID, option types.VoteOption) error {
	proposal, ok := keeper.GetProposal(ctx, proposalID)
	if !ok {
		return sdkerrors.Wrapf(types.ErrUnknownProposal, "%d", proposalID)
	}
	if proposal.Status != types.StatusVotingPeriod {
		return sdkerrors.Wrapf(types.ErrInactiveProposal, "%d", proposalID)
	}
	if !types.ValidVoteOption(option) {
		return sdkerrors.Wrap(types.ErrInvalidVote, option.String())
	}
	validatorVoter := keeper.sk.Validator(ctx, voterAddr)
	if validatorVoter == nil {
		return sdkerrors.Wrap(types.ErrInvalidVoter, voterAddr.String())
	}
	vote := types.NewVote(proposalID, voterAddr, option)
	keeper.SetVote(ctx, vote)
	ctx.EventManager().EmitEvent(
		sdk.NewEvent(
			types.EventTypeProposalVote,
			sdk.NewAttribute(types.AttributeKeyOption, option.String()),
			sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)),
		),
	)
	passed, _ := keeper.EmergencyPass(ctx, proposalID)
	if passed {
		keeper.RemoveFromActiveProposalQueue(ctx, proposalID, proposal.VotingEndTime)
		proposal.VotingEndTime = ctx.BlockHeader().Time
		keeper.SetProposal(ctx, proposal)
		keeper.InsertActiveProposalQueue(ctx, proposalID, proposal.VotingEndTime)
	}
	return nil
}
func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) {
	keeper.IterateAllVotes(ctx, func(vote types.Vote) bool {
		votes = append(votes, vote)
		return false
	})
	return
}