Skip to content

Commit

Permalink
fix typo issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Mar 8, 2025
1 parent 7255b46 commit 969be03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"google.golang.org/grpc/status"
)

func (q queryServer) Map<%= TypeName.UpperCamel %>(ctx context.Context, req *types.QueryAll<%= TypeName.UpperCamel %>Request) (*types.QueryAll<%= TypeName.UpperCamel %>Response, error) {
func (q queryServer) List<%= TypeName.UpperCamel %>(ctx context.Context, req *types.QueryAll<%= TypeName.UpperCamel %>Request) (*types.QueryAll<%= TypeName.UpperCamel %>Response, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "invalid request")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func Test<%= TypeName.UpperCamel %>QueryPaginated(t *testing.T) {
t.Run("ByOffset", func(t *testing.T) {
step := 2
for i := 0; i < len(msgs); i += step {
resp, err := qs.Map<%= TypeName.UpperCamel %>(f.ctx, request(nil, uint64(i), uint64(step), false))
resp, err := qs.List<%= TypeName.UpperCamel %>(f.ctx, request(nil, uint64(i), uint64(step), false))
require.NoError(t, err)
require.LessOrEqual(t, len(resp.<%= TypeName.UpperCamel %>), step)
require.Subset(t,
Expand All @@ -105,7 +105,7 @@ func Test<%= TypeName.UpperCamel %>QueryPaginated(t *testing.T) {
step := 2
var next []byte
for i := 0; i < len(msgs); i += step {
resp, err := qs.Map<%= TypeName.UpperCamel %>(f.ctx, request(next, 0, uint64(step), false))
resp, err := qs.List<%= TypeName.UpperCamel %>(f.ctx, request(next, 0, uint64(step), false))
require.NoError(t, err)
require.LessOrEqual(t, len(resp.<%= TypeName.UpperCamel %>), step)
require.Subset(t,
Expand All @@ -116,7 +116,7 @@ func Test<%= TypeName.UpperCamel %>QueryPaginated(t *testing.T) {
}
})
t.Run("Total", func(t *testing.T) {
resp, err := qs.Map<%= TypeName.UpperCamel %>(f.ctx, request(nil, 0, 0, true))
resp, err := qs.List<%= TypeName.UpperCamel %>(f.ctx, request(nil, 0, 0, true))
require.NoError(t, err)
require.Equal(t, len(msgs), int(resp.Pagination.Total))
require.ElementsMatch(t,
Expand All @@ -125,7 +125,7 @@ func Test<%= TypeName.UpperCamel %>QueryPaginated(t *testing.T) {
)
})
t.Run("InvalidRequest", func(t *testing.T) {
_, err := qs.Map<%= TypeName.UpperCamel %>(f.ctx, nil)
_, err := qs.List<%= TypeName.UpperCamel %>(f.ctx, nil)
require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request"))
})
}

0 comments on commit 969be03

Please sign in to comment.