issueRequest issues the JSON-RPC request
(reqBody *JSONRPCRequest)
| 324 | |
| 325 | // issueRequest issues the JSON-RPC request |
| 326 | func (client *EthereumClient) issueRequest(reqBody *JSONRPCRequest) ([]byte, error) { |
| 327 | |
| 328 | payload, err := reqBody.ToJSON() |
| 329 | if err != nil { |
| 330 | return nil, err |
| 331 | } |
| 332 | |
| 333 | reader := strings.NewReader(string(payload)) |
| 334 | resp, err := http.Post(client.URL, JSON_MEDIA_TYPE, reader) |
| 335 | if err != nil { |
| 336 | return nil, err |
| 337 | } |
| 338 | |
| 339 | body, err := ioutil.ReadAll(resp.Body) |
| 340 | defer resp.Body.Close() |
| 341 | if err != nil { |
| 342 | return nil, err |
| 343 | } |
| 344 | return body, nil |
| 345 | } |
| 346 | |
| 347 | // Eth_newBlockFilter calls the eth_newBlockFilter JSON-RPC method |
| 348 | func (client *EthereumClient) Eth_newBlockFilter() (string, error) { |
no test coverage detected