Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Jul 30, 2024
1 parent 02d7289 commit d6f6d7d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
1 change: 1 addition & 0 deletions schema/appdata/mux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestListenerMux(t *testing.T) {
}

func callAllCallbacksOnces(t *testing.T, listener Listener) {
t.Helper()
if err := listener.InitializeModuleData(ModuleInitializationData{}); err != nil {
t.Error(err)
}
Expand Down
21 changes: 1 addition & 20 deletions server/v2/api/grpc/gogoreflection/serverreflection.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import (
"sync"

gogoproto "github.com/cosmos/gogoproto/proto"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -305,24 +304,6 @@ func (s *serverReflectionServer) fileDescEncodingByFilename(name string, sentFil
return fileDescWithDependencies(fd, sentFileDescriptors)
}

// parseMetadata finds the file descriptor bytes specified meta.
// For SupportPackageIsVersion4, m is the name of the proto file, we
// call proto.FileDescriptor to get the byte slice.
// For SupportPackageIsVersion3, m is a byte slice itself.
func parseMetadata(meta interface{}) ([]byte, bool) {
// Check if meta is the file name.
if fileNameForMeta, ok := meta.(string); ok {
return getFileDescriptor(fileNameForMeta), true
}

// Check if meta is the byte slice.
if enc, ok := meta.([]byte); ok {
return enc, true
}

return nil, false
}

// fileDescEncodingContainingSymbol finds the file descriptor containing the
// given symbol, finds all of its previously unsent transitive dependencies,
// does marshaling on them, and returns the marshaled result. The given symbol
Expand Down Expand Up @@ -476,7 +457,7 @@ func (s *serverReflectionServer) ServerReflectionInfo(stream rpb.ServerReflectio
}
}

// getServices gets the unique list of services given a list of methods.
// getServices gets the unique list of services given a list of methods.
func (s *serverReflectionServer) getServices(methods []string) (svcs []string, fds []*dpb.FileDescriptorProto) {
registry, err := gogoproto.MergedRegistry()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion server/v2/api/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func getHeightFromCtx(ctx context.Context) (uint64, error) {
heightStr := values[0]
height, err := strconv.ParseUint(heightStr, 10, 64)
if err != nil {
return 0, fmt.Errorf("unable to parse height string from gRPC metadata %s: %v", heightStr, err)
return 0, fmt.Errorf("unable to parse height string from gRPC metadata %s: %w", heightStr, err)
}

return height, nil
Expand Down
2 changes: 1 addition & 1 deletion server/v2/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"
"time"

"cosmossdk.io/server/v2/appmanager"
gogoproto "github.com/cosmos/gogoproto/proto"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
Expand All @@ -17,6 +16,7 @@ import (
"cosmossdk.io/log"
serverv2 "cosmossdk.io/server/v2"
grpc "cosmossdk.io/server/v2/api/grpc"
"cosmossdk.io/server/v2/appmanager"
)

type mockInterfaceRegistry struct{}
Expand Down

0 comments on commit d6f6d7d

Please sign in to comment.