Skip to content

Commit

Permalink
fix arg handling
Browse files Browse the repository at this point in the history
  • Loading branch information
slugalisk committed Oct 25, 2021
1 parent 99405e6 commit d068cc0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/ts-go-ipc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace github.com/MemeLabs/protobuf => ../../

require (
github.com/MemeLabs/protobuf v0.1.15
github.com/golang/protobuf v1.5.2
github.com/golang/protobuf v1.5.2 // indirect
go.uber.org/zap v1.16.0
google.golang.org/protobuf v1.26.0
)
2 changes: 0 additions & 2 deletions examples/ts-go-ipc/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@memelabs/protobuf",
"version": "0.2.1",
"version": "0.2.2",
"description": "",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type ServiceDispatcher struct {
func (h *ServiceDispatcher) RegisterMethod(name string, method interface{}) {
h.methods[name] = serviceMethod{
fn: reflect.ValueOf(method),
arg: reflect.TypeOf(method).In(1),
arg: reflect.TypeOf(method).In(1).Elem(),
requestCount: serverRequestCount.WithLabelValues(name),
requestDurationMs: serverRequestDurationMs.WithLabelValues(name),
errorCount: serverRequestCount.WithLabelValues(name),
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ export default class Host {

switch (res.kind) {
case Call.Kind.CALL_KIND_DEFAULT:
resolve(Message.decode(call.argument));
resolve(Message.decode(res.argument));
break;
case Call.Kind.CALL_KIND_ERROR:
reject(Error.decode(call.argument));
reject(Error.decode(res.argument));
break;
}
});
Expand Down

0 comments on commit d068cc0

Please sign in to comment.