-
Notifications
You must be signed in to change notification settings - Fork 15
Labels
Description
This signature:
func RPCCall(ctx *NodeContext, msg proto.Message, method string) (proto.Message, error) {Should be changed to this:
func RPCCall[Req, Resp proto.Message](ctx *NodeContext, req Req, method string) (Resp, error) {This will allow callers (generated code) to do this:
func ReadRPC(ctx *NodeContext, in *ReadRequest) (resp *ReadResponse, err error) {
return gorums.RPCCall[*ReadRequest, *ReadResponse](ctx, in, "proto.Storage.ReadRPC")
}Instead of this:
func ReadRPC(ctx *NodeContext, in *ReadRequest) (resp *ReadResponse, err error) {
res, err := gorums.RPCCall(ctx, in, "proto.Storage.ReadRPC")
if err != nil {
return nil, err
}
return res.(*ReadResponse), err
}Reactions are currently unavailable