Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
piux2 committed Dec 27, 2024
1 parent 599e64a commit b7f317a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 135 deletions.
132 changes: 0 additions & 132 deletions examples/gno.land/r/gov/dao/v2/prop4_filetest.gno

This file was deleted.

5 changes: 3 additions & 2 deletions tm2/pkg/sdk/params/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,18 @@ type Params struct {
}

func TestGetAndSetParams(t *testing.T) {
prefix := "params_test"
env := setupTestEnv()
ctx := env.ctx
keeper := env.keeper
// SetParams
a := Params{p1: 1, p2: "a"}
err := keeper.SetParams(ctx, ModuleName, "p", a)
err := keeper.SetParams(ctx, prefix, "p", a)
require.NoError(t, err)

// GetParams
a1 := Params{}
_, err1 := keeper.GetParams(ctx, ModuleName, "p", &a1)
_, err1 := keeper.GetParams(ctx, prefix, "p", &a1)
require.NoError(t, err1)
require.True(t, amino.DeepEqual(a, a1), "a and a1 should equal")
}
3 changes: 2 additions & 1 deletion tm2/pkg/sdk/params/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ func setupTestEnv() testEnv {
ms.MountStoreWithDB(paramsCapKey, iavl.StoreConstructor, db)
ms.LoadLatestVersion()

prefix := "params_test"
km := NewPrefixKeyMapper()
km.RegisterPrefix(ModuleName)
km.RegisterPrefix(prefix)
keeper := NewParamsKeeper(paramsCapKey, km)

ctx := sdk.NewContext(sdk.RunTxModeDeliver, ms, &bft.Header{Height: 1, ChainID: "test-chain-id"}, log.NewNoopLogger())
Expand Down

0 comments on commit b7f317a

Please sign in to comment.