Skip to content

Commit

Permalink
some more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Aug 9, 2024
1 parent 535282c commit 4ebe495
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions runtime/v2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,19 +667,19 @@ func registerMethod(

return string(requestName), stfRouter.RegisterHandler(string(requestName), func(
ctx context.Context,
msg appmodulev2.Message,
) (resp appmodulev2.Message, err error) {
msg transaction.Msg,
) (resp transaction.Msg, err error) {
res, err := md.Handler(ss, ctx, noopDecoder, messagePassingInterceptor(msg))
if err != nil {
return nil, err
}
return res.(appmodulev2.Message), nil
return res.(transaction.Msg), nil
})
}

func noopDecoder(_ interface{}) error { return nil }

func messagePassingInterceptor(msg appmodulev2.Message) grpc.UnaryServerInterceptor {
func messagePassingInterceptor(msg transaction.Msg) grpc.UnaryServerInterceptor {
return func(
ctx context.Context,
req interface{},
Expand Down
4 changes: 2 additions & 2 deletions server/v2/stf/stf_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ func (r coreRouterImpl) CanInvoke(_ context.Context, typeURL string) error {
return nil
}

func (r coreRouterImpl) InvokeTyped(ctx context.Context, req, resp gogoproto.Message) error {
func (r coreRouterImpl) InvokeTyped(ctx context.Context, req, resp transaction.Msg) error {
handlerResp, err := r.InvokeUntyped(ctx, req)
if err != nil {
return err
}
return merge(handlerResp, resp)
}

func (r coreRouterImpl) InvokeUntyped(ctx context.Context, req gogoproto.Message) (res gogoproto.Message, err error) {
func (r coreRouterImpl) InvokeUntyped(ctx context.Context, req transaction.Msg) (res transaction.Msg, err error) {
typeName := msgTypeURL(req)
handler, exists := r.handlers[typeName]
if !exists {
Expand Down

0 comments on commit 4ebe495

Please sign in to comment.