Skip to content

Commit

Permalink
fix wrong keeper arg pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani authored and Pantani committed Jun 27, 2023
1 parent e59427b commit af9876d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var _ = strconv.IntSize

func Test<%= TypeName.UpperCamel %>MsgServerCreate(t *testing.T) {
k, ctx := keepertest.<%= title(ModuleName) %>Keeper(t)
srv := keeper.NewMsgServerImpl(*k)
srv := keeper.NewMsgServerImpl(k)
wctx := sdk.WrapSDKContext(ctx)
<%= MsgSigner.LowerCamel %> := "A"
for i := 0; i < 5; i++ {
Expand Down Expand Up @@ -72,7 +72,7 @@ func Test<%= TypeName.UpperCamel %>MsgServerUpdate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.desc, func(t *testing.T) {
k, ctx := keepertest.<%= title(ModuleName) %>Keeper(t)
srv := keeper.NewMsgServerImpl(*k)
srv := keeper.NewMsgServerImpl(k)
wctx := sdk.WrapSDKContext(ctx)
expected := &types.MsgCreate<%= TypeName.UpperCamel %>{<%= MsgSigner.UpperCamel %>: <%= MsgSigner.LowerCamel %>,
<%= for (i, index) in Indexes { %><%= index.Name.UpperCamel %>: <%= index.ValueIndex() %>,
Expand Down Expand Up @@ -132,7 +132,7 @@ func Test<%= TypeName.UpperCamel %>MsgServerDelete(t *testing.T) {
for _, tc := range tests {
t.Run(tc.desc, func(t *testing.T) {
k, ctx := keepertest.<%= title(ModuleName) %>Keeper(t)
srv := keeper.NewMsgServerImpl(*k)
srv := keeper.NewMsgServerImpl(k)
wctx := sdk.WrapSDKContext(ctx)

_, err := srv.Create<%= TypeName.UpperCamel %>(wctx, &types.MsgCreate<%= TypeName.UpperCamel %>{<%= MsgSigner.UpperCamel %>: <%= MsgSigner.LowerCamel %>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"<%= ModulePath %>/testutil/nullify"
)

func createTest<%= TypeName.UpperCamel %>(keeper *keeper.Keeper, ctx sdk.Context) types.<%= TypeName.UpperCamel %> {
func createTest<%= TypeName.UpperCamel %>(keeper keeper.Keeper, ctx sdk.Context) types.<%= TypeName.UpperCamel %> {
item := types.<%= TypeName.UpperCamel %>{}
keeper.Set<%= TypeName.UpperCamel %>(ctx, item)
return item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func Test<%= TypeName.UpperCamel %>MsgServerCreate(t *testing.T) {
k, ctx := keepertest.<%= title(ModuleName) %>Keeper(t)
srv := keeper.NewMsgServerImpl(*k)
srv := keeper.NewMsgServerImpl(k)
wctx := sdk.WrapSDKContext(ctx)
<%= MsgSigner.LowerCamel %> := "A"
expected := &types.MsgCreate<%= TypeName.UpperCamel %>{<%= MsgSigner.UpperCamel %>: <%= MsgSigner.LowerCamel %>}
Expand Down Expand Up @@ -46,7 +46,7 @@ func Test<%= TypeName.UpperCamel %>MsgServerUpdate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.desc, func(t *testing.T) {
k, ctx := keepertest.<%= title(ModuleName) %>Keeper(t)
srv := keeper.NewMsgServerImpl(*k)
srv := keeper.NewMsgServerImpl(k)
wctx := sdk.WrapSDKContext(ctx)
expected := &types.MsgCreate<%= TypeName.UpperCamel %>{<%= MsgSigner.UpperCamel %>: <%= MsgSigner.LowerCamel %>}
_, err := srv.Create<%= TypeName.UpperCamel %>(wctx, expected)
Expand Down Expand Up @@ -86,7 +86,7 @@ func Test<%= TypeName.UpperCamel %>MsgServerDelete(t *testing.T) {
for _, tc := range tests {
t.Run(tc.desc, func(t *testing.T) {
k, ctx := keepertest.<%= title(ModuleName) %>Keeper(t)
srv := keeper.NewMsgServerImpl(*k)
srv := keeper.NewMsgServerImpl(k)
wctx := sdk.WrapSDKContext(ctx)

_, err := srv.Create<%= TypeName.UpperCamel %>(wctx, &types.MsgCreate<%= TypeName.UpperCamel %>{<%= MsgSigner.UpperCamel %>: <%= MsgSigner.LowerCamel %>})
Expand Down

0 comments on commit af9876d

Please sign in to comment.