* Update default historical header number * Update x/staking/types/params.go Co-authored-by: Amaury <amaury.martiny@protonmail.com> * fix tests * duh Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Amaury <amaury.martiny@protonmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
38 lines
905 B
Go
38 lines
905 B
Go
package simulation_test
|
|
|
|
import (
|
|
"math/rand"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/cosmos/cosmos-sdk/x/staking/simulation"
|
|
)
|
|
|
|
func TestParamChanges(t *testing.T) {
|
|
s := rand.NewSource(1)
|
|
r := rand.New(s)
|
|
|
|
expected := []struct {
|
|
composedKey string
|
|
key string
|
|
simValue string
|
|
subspace string
|
|
}{
|
|
{"staking/MaxValidators", "MaxValidators", "82", "staking"},
|
|
{"staking/UnbondingTime", "UnbondingTime", "\"275307000000000\"", "staking"},
|
|
{"staking/HistoricalEntries", "HistoricalEntries", "9149", "staking"},
|
|
}
|
|
|
|
paramChanges := simulation.ParamChanges(r)
|
|
|
|
require.Len(t, paramChanges, 3)
|
|
|
|
for i, p := range paramChanges {
|
|
require.Equal(t, expected[i].composedKey, p.ComposedKey())
|
|
require.Equal(t, expected[i].key, p.Key())
|
|
require.Equal(t, expected[i].simValue, p.SimValue()(r))
|
|
require.Equal(t, expected[i].subspace, p.Subspace())
|
|
}
|
|
}
|