2020-03-02 06:56:26 -08:00
|
|
|
package keeper_test
|
2019-08-08 12:51:18 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2020-03-02 06:56:26 -08:00
|
|
|
"github.com/cosmos/cosmos-sdk/simapp"
|
|
|
|
abci "github.com/tendermint/tendermint/abci/types"
|
2020-01-16 13:46:51 -08:00
|
|
|
|
2020-03-02 06:56:26 -08:00
|
|
|
"github.com/stretchr/testify/require"
|
2019-08-08 12:51:18 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestIncrementProposalNumber(t *testing.T) {
|
2020-03-02 06:56:26 -08:00
|
|
|
app := simapp.Setup(false)
|
|
|
|
ctx := app.BaseApp.NewContext(false, abci.Header{})
|
2019-08-08 12:51:18 -07:00
|
|
|
|
|
|
|
tp := TestProposal
|
2020-03-02 06:56:26 -08:00
|
|
|
app.GovKeeper.SubmitProposal(ctx, tp)
|
|
|
|
app.GovKeeper.SubmitProposal(ctx, tp)
|
|
|
|
app.GovKeeper.SubmitProposal(ctx, tp)
|
|
|
|
app.GovKeeper.SubmitProposal(ctx, tp)
|
|
|
|
app.GovKeeper.SubmitProposal(ctx, tp)
|
|
|
|
proposal6, err := app.GovKeeper.SubmitProposal(ctx, tp)
|
2019-08-08 12:51:18 -07:00
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
require.Equal(t, uint64(6), proposal6.ProposalID)
|
|
|
|
}
|