cosmos-sdk/x/ibc-transfer/simulation/params_test.go
Federico Kunze 0234ad324e
ibc-transfer: sims updates (#7123)
* ibc-transfer: sims updates

* params and genesis

* sim tests

* update module.go

* remove dontcover

* Update x/ibc-transfer/simulation/decoder.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-21 04:52:46 -04:00

37 lines
836 B
Go

package simulation_test
import (
"math/rand"
"testing"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/x/ibc-transfer/simulation"
)
func TestParamChanges(t *testing.T) {
s := rand.NewSource(1)
r := rand.New(s)
expected := []struct {
composedKey string
key string
simValue string
subspace string
}{
{"transfer/SendEnabled", "SendEnabled", "false", "transfer"},
{"transfer/ReceiveEnabled", "ReceiveEnabled", "true", "transfer"},
}
paramChanges := simulation.ParamChanges(r)
require.Len(t, paramChanges, 2)
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), p.Key())
require.Equal(t, expected[i].subspace, p.Subspace())
}
}