30 lines
726 B
Go
30 lines
726 B
Go
package keeper_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
abci "github.com/tendermint/tendermint/abci/types"
|
|
|
|
"github.com/cosmos/cosmos-sdk/simapp"
|
|
"github.com/cosmos/cosmos-sdk/x/staking/types"
|
|
)
|
|
|
|
func TestParams(t *testing.T) {
|
|
app := simapp.Setup(false)
|
|
ctx := app.BaseApp.NewContext(false, abci.Header{})
|
|
|
|
expParams := types.DefaultParams()
|
|
|
|
//check that the empty keeper loads the default
|
|
resParams := app.StakingKeeper.GetParams(ctx)
|
|
require.True(t, expParams.Equal(resParams))
|
|
|
|
//modify a params, save, and retrieve
|
|
expParams.MaxValidators = 777
|
|
app.StakingKeeper.SetParams(ctx, expParams)
|
|
resParams = app.StakingKeeper.GetParams(ctx)
|
|
require.True(t, expParams.Equal(resParams))
|
|
}
|