WS JsonRPC client

This commit is contained in:
Łukasz Magiera
2019-07-12 17:29:41 +02:00
parent ea2039ecb6
commit 0eb208e1d3
5 changed files with 117 additions and 67 deletions
+3 -3
View File
@@ -6,8 +6,8 @@ import (
)
// NewRPC creates a new http jsonrpc client.
func NewRPC(addr string) api.API {
func NewRPC(addr string) (api.API, error) {
var res api.Struct
jsonrpc.NewClient(addr, "Filecoin", &res.Internal)
return &res
_, err := jsonrpc.NewClient(addr, "Filecoin", &res.Internal)
return &res, err
}