diff --git a/x/gov/keeper/old_tally_test.go b/x/gov/keeper/old_tally_test.go index e68f182a1d06..ab324dfcb597 100644 --- a/x/gov/keeper/old_tally_test.go +++ b/x/gov/keeper/old_tally_test.go @@ -10,29 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" ) -func TestTallyOnlyValidatorsNonVoter(t *testing.T) { - ctx, _, _, keeper, sk, _ := createTestInput(t, false, 100) - createValidators(ctx, sk, []int64{5, 6, 7}) - - tp := TestProposal - proposal, err := keeper.SubmitProposal(ctx, tp) - require.NoError(t, err) - proposalID := proposal.ProposalID - proposal.Status = types.StatusVotingPeriod - keeper.SetProposal(ctx, proposal) - - require.NoError(t, keeper.AddVote(ctx, proposalID, valAccAddr1, types.OptionYes)) - require.NoError(t, keeper.AddVote(ctx, proposalID, valAccAddr2, types.OptionNo)) - - proposal, ok := keeper.GetProposal(ctx, proposalID) - require.True(t, ok) - passes, burnDeposits, tallyResults := keeper.Tally(ctx, proposal) - - require.False(t, passes) - require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) -} - func TestTallyDelgatorOverride(t *testing.T) { ctx, _, _, keeper, sk, _ := createTestInput(t, false, 100) createValidators(ctx, sk, []int64{5, 6, 7}) diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 099659f22d51..920f66c5831b 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -212,3 +212,29 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { require.False(t, burnDeposits) require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } + +func TestTallyOnlyValidatorsNonVoter(t *testing.T) { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, abci.Header{}) + + valAccAddrs, _ := createValidators(ctx, app, []int64{5, 6, 7}) + valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] + + tp := TestProposal + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + require.NoError(t, err) + proposalID := proposal.ProposalID + proposal.Status = types.StatusVotingPeriod + app.GovKeeper.SetProposal(ctx, proposal) + + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr1, types.OptionYes)) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr2, types.OptionNo)) + + proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) + require.True(t, ok) + passes, burnDeposits, tallyResults := app.GovKeeper.Tally(ctx, proposal) + + require.False(t, passes) + require.False(t, burnDeposits) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) +}