Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Keefe Liu committed Jul 2, 2024
1 parent 539b449 commit 84a9a7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions runtime/services/reflection.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"compress/gzip"
"context"
"io"
"strings"

reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
"github.com/cosmos/gogoproto/proto"
Expand Down Expand Up @@ -57,8 +58,8 @@ func NewReflectionService() (*ReflectionService, error) {
return true
})

slices.SortFunc(fds.File, func(x, y *descriptorpb.FileDescriptorProto) bool {
return *x.Name < *y.Name
slices.SortFunc(fds.File, func(x, y *descriptorpb.FileDescriptorProto) int {
return strings.Compare(*x.Name, *y.Name)
})

return &ReflectionService{files: fds}, nil
Expand Down
5 changes: 3 additions & 2 deletions x/gov/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"sort"
"strings"

abci "github.com/cometbft/cometbft/abci/types"
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
Expand Down Expand Up @@ -228,8 +229,8 @@ func InvokeAddRoutes(keeper *keeper.Keeper, routes []v1beta1.HandlerRoute) {

// Default route order is a lexical sort by RouteKey.
// Explicit ordering can be added to the module config if required.
slices.SortFunc(routes, func(x, y v1beta1.HandlerRoute) bool {
return x.RouteKey < y.RouteKey
slices.SortFunc(routes, func(x, y v1beta1.HandlerRoute) int {
return strings.Compare(x.RouteKey, y.RouteKey)
})

router := v1beta1.NewRouter()
Expand Down

0 comments on commit 84a9a7d

Please sign in to comment.