Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRT-499 adding grpc default case #390

Merged
merged 1 commit into from
Apr 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions protocol/chainlib/chainproxy/thirdparty/grpcServerRegistery.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,10 @@ func RegisterServer(chain string, cb func(ctx context.Context, method string, re
ibc_thirdparty.RegisterJunoProtobufs(s, cb)
juno_thirdparty.RegisterJunoProtobufs(s, cb)
cosmwasm.RegisterJunoProtobufs(s, cb)
case "EVMOS", "EVMOST":
cosmos_thirdparty.RegisterCosmosProtobufs(s, cb)
ibc_thirdparty.RegisterCosmosProtobufs(s, cb)
//TODO: add other evmos protobufs missing
case "CANTO", "CANTOT":
cosmos_thirdparty.RegisterCosmosProtobufs(s, cb)
ibc_thirdparty.RegisterCosmosProtobufs(s, cb)
//TODO: add other canto protobufs missing
case "AXELAR", "AXELART":
default:
utils.LavaFormatWarning("Spec ID is not in grpc server registry, setting the default descriptors of cosmos", nil)
cosmos_thirdparty.RegisterCosmosProtobufs(s, cb)
ibc_thirdparty.RegisterCosmosProtobufs(s, cb)
//TODO: add other canto protobufs missing
default:
utils.LavaFormatFatal("Unsupported Chain Server: "+chain, nil)
}

utils.LavaFormatInfo("gogoreflection.Register()")
Expand Down
4 changes: 3 additions & 1 deletion protocol/chainlib/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ func (cp *GrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{},
connectCtx, cancel := context.WithTimeout(ctx, relayTimeout)
defer cancel()

cl := grpcreflect.NewClient(ctx, reflectionpbo.NewServerReflectionClient(conn)) // TODO: improve functionality, this is reading descriptors every send
// TODO: improve functionality, this is reading descriptors every send
// improvement would be caching the descriptors, instead of fetching them.
cl := grpcreflect.NewClient(ctx, reflectionpbo.NewServerReflectionClient(conn))
descriptorSource := rpcInterfaceMessages.DescriptorSourceFromServer(cl)
svc, methodName := rpcInterfaceMessages.ParseSymbol(nodeMessage.Path)
var descriptor desc.Descriptor
Expand Down