Skip to content

Commit e9e8564

Browse files
committed
updates
1 parent 487db3b commit e9e8564

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

client/v2/internal/util/util.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ func ResolveMessageType(resolver protoregistry.MessageTypeResolver, descriptor p
3636
// IsSupportedVersion is used to determine in which version of a module / sdk a rpc was introduced.
3737
// It returns false if the rpc has comment for an higher version than the current one.
3838
func IsSupportedVersion(methodDesc protoreflect.MethodDescriptor) bool {
39-
return IsSupportedVersionWithCustomBuildInfo(methodDesc, buildInfo)
39+
return isSupportedVersion(methodDesc, buildInfo)
4040
}
4141

42-
// IsSupportedVersionWithBuildInfo is used to determine in which version of a module / sdk a rpc was introduced.
42+
// isSupportedVersion is used to determine in which version of a module / sdk a rpc was introduced.
4343
// It returns false if the rpc has comment for an higher version than the current one.
4444
// It takes a buildInfo as argument to be able to test it.
45-
func IsSupportedVersionWithCustomBuildInfo(methodDesc protoreflect.MethodDescriptor, buildInfo *debug.BuildInfo) bool {
45+
func isSupportedVersion(methodDesc protoreflect.MethodDescriptor, buildInfo *debug.BuildInfo) bool {
4646
hasVersion := proto.HasExtension(methodDesc.Options(), cosmos_proto.E_MethodAddedIn)
47-
if !hasVersion || buildInfo == nil {
47+
if !hasVersion || buildInfo == nil || len(buildInfo.Deps) == 0 {
4848
return true
4949
}
5050

client/v2/internal/util/util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestIsSupportedVersion(t *testing.T) {
5050
}
5151

5252
methodDesc := desc.(protoreflect.MethodDescriptor)
53-
isSupported := IsSupportedVersionWithCustomBuildInfo(methodDesc, mockBuildInfo)
53+
isSupported := isSupportedVersion(methodDesc, mockBuildInfo)
5454
if isSupported != tc.expected {
5555
t.Errorf("expected %v, got %v for %s", tc.expected, isSupported, methodDesc.FullName())
5656
}

0 commit comments

Comments
 (0)