Skip to content

Commit

Permalink
Add jsonrpc version to request (umbracle#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt authored Oct 24, 2021
1 parent 1a00db7 commit 72a8ff8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions jsonrpc/codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (

// Request is a jsonrpc request
type Request struct {
ID uint64 `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params"`
JsonRPC string `json:"jsonrpc"`
ID uint64 `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params"`
}

// Response is a jsonrpc response
Expand Down
3 changes: 2 additions & 1 deletion jsonrpc/transport/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ func (h *HTTP) Close() error {
func (h *HTTP) Call(method string, out interface{}, params ...interface{}) error {
// Encode json-rpc request
request := codec.Request{
Method: method,
JsonRPC: "2.0",
Method: method,
}
if len(params) > 0 {
data, err := json.Marshal(params)
Expand Down

0 comments on commit 72a8ff8

Please sign in to comment.