mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-08 21:10:10 +00:00
use EventSwitch interface; less logging
This commit is contained in:
@@ -119,7 +119,7 @@ func (c *ClientURI) call(method string, params map[string]interface{}, result in
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Info(Fmt("URI request to %v (%v): %v", c.address, method, values))
|
||||
//log.Info(Fmt("URI request to %v (%v): %v", c.address, method, values))
|
||||
resp, err := c.client.PostForm(c.address+"/"+method, values)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -138,19 +138,23 @@ func unmarshalResponseBytes(responseBytes []byte, result interface{}) (interface
|
||||
// read response
|
||||
// if rpc/core/types is imported, the result will unmarshal
|
||||
// into the correct type
|
||||
// log.Notice("response", "response", string(responseBytes))
|
||||
var err error
|
||||
response := &rpctypes.RPCResponse{}
|
||||
err = json.Unmarshal(responseBytes, response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.New(Fmt("Error unmarshalling rpc response: %v", err))
|
||||
}
|
||||
errorStr := response.Error
|
||||
if errorStr != "" {
|
||||
return nil, errors.New(errorStr)
|
||||
return nil, errors.New(Fmt("Response error: %v", errorStr))
|
||||
}
|
||||
// unmarshal the RawMessage into the result
|
||||
result = wire.ReadJSONPtr(result, *response.Result, &err)
|
||||
return result, err
|
||||
if err != nil {
|
||||
return nil, errors.New(Fmt("Error unmarshalling rpc response result: %v", err))
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func argsToURLValues(args map[string]interface{}) (url.Values, error) {
|
||||
|
||||
Reference in New Issue
Block a user