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

Add support for JSON-RPC batched calls #341

Merged
merged 4 commits into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Add comments and make linter a bit happier.
  • Loading branch information
divan committed Sep 18, 2017
commit 8aa800b4a0c0791c0354793e41182d51a1a5a01c
6 changes: 3 additions & 3 deletions geth/rpc/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# rpc [![GoDoc](https://godoc.org/github.com/status-im/status-go/geth/rpc?status.png)](https://godoc.org/github.com/status-im/status-go/geth/rpc)
rpc - JSON-RPC client with custom routing.
Package rpc - JSON-RPC client with custom routing.

Download:
```shell
go get github.com/status-im/status-go/geth/rpc
```

* * *
rpc - JSON-RPC client with custom routing.
Package rpc - JSON-RPC client with custom routing.

Package rpc implements status-go JSON-RPC client and handles
requests to different endpoints: upstream or local node.
Expand All @@ -27,4 +27,4 @@ Note, upon creation of a new client, it ok to be offline - client will keep tryi


* * *
Automatically generated by [autoreadme](https://github.com/jimmyfrasche/autoreadme) on 2017.09.15
Automatically generated by [autoreadme](https://github.com/jimmyfrasche/autoreadme) on 2017.09.18
1 change: 1 addition & 0 deletions geth/rpc/call_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (c *Client) callBatchMethods(ctx context.Context, msgs json.RawMessage) str
return string(data)
}

// callSingleMethod executes single JSON-RPC message and constructs proper response.
func (c *Client) callSingleMethod(ctx context.Context, msg json.RawMessage) string {
// unmarshal JSON body into json-rpc request
method, params, id, err := methodAndParamsFromBody(msg)
Expand Down
2 changes: 1 addition & 1 deletion geth/rpc/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
rpc - JSON-RPC client with custom routing.
Package rpc - JSON-RPC client with custom routing.

Package rpc implements status-go JSON-RPC client and handles
requests to different endpoints: upstream or local node.
Expand Down