cosmos-sdk/x/gov/keeper
Cuong Manh Le 6ad84c5065
x/gov/keeper: fix flaky TestPaginatedVotesQuery (#9223)
When testing with -race, sometimes the random source generate the same
string for consecutive calls, causing duplicated voter address. So the
number of votes in DB is not 20.

To fix this, we ensure unique addresses are generated, by using a map
for tracking which one was produced, and skip the duplicated address and
generated new one. Testing with:

	go test -race -v -count=1000 -run=TestPaginatedVotesQuery

now passes.

Updates #9010
2021-04-28 17:08:42 +00:00
..
common_test.go use on-chain params on tests + fix tests + add new tests for power reduction change 2021-01-28 23:54:39 +10:00
deposit.go Add hooks to governance actions (#9133) 2021-04-21 12:59:30 -04:00
deposit_test.go use on-chain params on tests + fix tests + add new tests for power reduction change 2021-01-28 23:54:39 +10:00
grpc_query.go Change `address` from bytes to bech32 strings (#7242) 2020-09-25 10:25:37 +00:00
grpc_query_test.go merged in master 2021-03-21 16:37:06 -04:00
hooks.go Add hooks to governance actions (#9133) 2021-04-21 12:59:30 -04:00
hooks_test.go Add hooks to governance actions (#9133) 2021-04-21 12:59:30 -04:00
internal_test.go Add hooks to governance actions (#9133) 2021-04-21 12:59:30 -04:00
invariants.go Merge PR #5572: ADR 004 Implementation 2020-01-30 16:31:16 -05:00
keeper.go Add hooks to governance actions (#9133) 2021-04-21 12:59:30 -04:00
keeper_test.go tendermint: update to rc3 (#6892) 2020-08-14 13:58:53 -04:00
migrations.go Move all migration scripts to v043 (#8814) 2021-03-08 22:36:06 +00:00
msg_server.go MsgWeightedVote -> MsgVoteWeighted 2021-01-24 20:54:25 -05:00
params.go Merge PR #4665: Refactor x/gov Module Structure (prep for module spec) 2019-08-08 15:51:18 -04:00
proposal.go Add hooks to governance actions (#9133) 2021-04-21 12:59:30 -04:00
proposal_test.go refactor SubVote to WeightedVoteOption && add utility for NewNonSplitVoteOption 2020-10-30 23:14:39 +10:00
querier.go Make JSONMarshaler methods require proto.Message (#7054) 2020-08-26 09:39:38 +00:00
querier_test.go x/gov/keeper: fix flaky TestPaginatedVotesQuery (#9223) 2021-04-28 17:08:42 +00:00
tally.go Merge pull request #39 from antstalepresh/gov_split_vote 2020-11-04 10:31:55 +10:00
tally_test.go merged in master 2021-03-21 16:37:06 -04:00
vote.go Add hooks to governance actions (#9133) 2021-04-21 12:59:30 -04:00
vote_test.go refactor SubVote to WeightedVoteOption && add utility for NewNonSplitVoteOption 2020-10-30 23:14:39 +10:00