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 Version to JSON-RPC client request #990

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion transport/http/jsonrpc/client.go
Expand Up @@ -164,7 +164,7 @@ func (c Client) Endpoint() endpoint.Endpoint {
return nil, err
}
rpcReq := clientRequest{
JSONRPC: "",
JSONRPC: Version,
Method: c.method,
Params: params,
ID: c.requestID.Generate(),
Expand Down
3 changes: 3 additions & 0 deletions transport/http/jsonrpc/client_test.go
Expand Up @@ -133,6 +133,9 @@ func TestClientHappyPath(t *testing.T) {
if id, _ := requestAtServer.ID.Int(); id != wantID {
t.Fatalf("Request ID at server: want=%d, got=%d", wantID, id)
}
if requestAtServer.JSONRPC != jsonrpc.Version {
t.Fatalf("JSON-RPC version at server: want=%s, got=%s", jsonrpc.Version, requestAtServer.JSONRPC)
}

var paramsAtServer addRequest
err = json.Unmarshal(requestAtServer.Params, &paramsAtServer)
Expand Down