Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mossid committed Oct 13, 2018
1 parent fb78f1d commit 73d83b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions x/params/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ recommended to use the same name with the module's.
ps params.Subspace
}
Pass a params.Subspace to NewKeeper with DefaultParamSubspace (or another)
Pass a params.Subspace to NewKeeper with DefaultParamspace (or another)
app.myKeeper = mymodule.NewKeeper(app.paramStore.SubStore(mymodule.DefaultParamspace))
Expand Down Expand Up @@ -79,7 +79,7 @@ params.Keeper itself to access all subspace(using GetSubspace)
}
func (k MasterKeeper) SetParam(ctx sdk.Context, space string, key string, param interface{}) {
space, ok := k.ps.GetSubspace(space)
space, ok := k.pk.GetSubspace(space)
if !ok {
return
}
Expand Down
12 changes: 6 additions & 6 deletions x/params/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestKeeper(t *testing.T) {
for i, kv := range kvs {
var param int64
require.NotPanics(t, func() { space.Get(ctx, []byte(kv.key), &param) }, "space.Get panics, tc #%d", i)
require.Equal(t, kv.param, param, "param not equal, tc #%d", i)
require.Equal(t, kv.param, param, "stored param not equal, tc #%d", i)
}

// Test space.GetRaw
Expand All @@ -91,7 +91,7 @@ func TestKeeper(t *testing.T) {
bz := space.GetRaw(ctx, []byte(kv.key))
err := cdc.UnmarshalJSON(bz, &param)
require.Nil(t, err, "err is not nil, tc #%d", i)
require.Equal(t, kv.param, param, "param not equal, tc #%d", i)
require.Equal(t, kv.param, param, "stored param not equal, tc #%d", i)
}

// Test store.Get equals space.Get
Expand All @@ -101,7 +101,7 @@ func TestKeeper(t *testing.T) {
require.NotNil(t, bz, "KVStore.Get returns nil, tc #%d", i)
err := cdc.UnmarshalJSON(bz, &param)
require.NoError(t, err, "UnmarshalJSON returns error, tc #%d", i)
require.Equal(t, kv.param, param, "param not equal, tc #%d", i)
require.Equal(t, kv.param, param, "stored param not equal, tc #%d", i)
}

// Test invalid space.Get
Expand Down Expand Up @@ -195,9 +195,9 @@ func TestSubspace(t *testing.T) {
require.Equal(t, kv.zero, indirect(kv.ptr), "invalid space.Get unmarshalls when no value exists, tc #%d", i)

require.NotPanics(t, func() { space.GetIfExists(ctx, []byte(kv.key), kv.ptr) }, "space.GetIfExists panics, tc #%d", i)
require.Equal(t, kv.param, indirect(kv.ptr), "spaced param not equal, tc #%d", i)
require.Equal(t, kv.param, indirect(kv.ptr), "stored param not equal, tc #%d", i)
require.NotPanics(t, func() { space.Get(ctx, []byte(kv.key), kv.ptr) }, "space.Get panics, tc #%d", i)
require.Equal(t, kv.param, indirect(kv.ptr), "spaced param not equal, tc #%d", i)
require.Equal(t, kv.param, indirect(kv.ptr), "stored param not equal, tc #%d", i)

require.Panics(t, func() { space.Get(ctx, []byte("invalid"), kv.ptr) }, "invalid space.Get not panics when no value exists, tc #%d", i)
require.Equal(t, kv.param, indirect(kv.ptr), "invalid space.Get unmarshalls when no value existt, tc #%d", i)
Expand All @@ -212,6 +212,6 @@ func TestSubspace(t *testing.T) {
require.NotNil(t, bz, "store.Get() returns nil, tc #%d", i)
err := cdc.UnmarshalJSON(bz, kv.ptr)
require.NoError(t, err, "cdc.UnmarshalJSON() returns error, tc #%d", i)
require.Equal(t, kv.param, indirect(kv.ptr), "param not equal, tc #%d", i)
require.Equal(t, kv.param, indirect(kv.ptr), "stored param not equal, tc #%d", i)
}
}

0 comments on commit 73d83b0

Please sign in to comment.