diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 6d9d014871f1..282f1a44c210 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -316,13 +316,23 @@ func TestPaginatedVotesQuery(t *testing.T) { app.GovKeeper.SetProposal(ctx, proposal) votes := make([]types.Vote, 20) - rand := rand.New(rand.NewSource(time.Now().UnixNano())) - addr := make(sdk.AccAddress, 20) + random := rand.New(rand.NewSource(time.Now().UnixNano())) + addrMap := make(map[string]struct{}) + genAddr := func() string { + addr := make(sdk.AccAddress, 20) + for { + random.Read(addr) + addrStr := addr.String() + if _, ok := addrMap[addrStr]; !ok { + addrMap[addrStr] = struct{}{} + return addrStr + } + } + } for i := range votes { - rand.Read(addr) vote := types.Vote{ ProposalId: proposal.ProposalId, - Voter: addr.String(), + Voter: genAddr(), Options: types.NewNonSplitVoteOption(types.OptionYes), } votes[i] = vote