Fix rpc tests

This commit is contained in:
Jae Kwon
2018-04-05 21:19:14 -07:00
parent c541d58d2f
commit 3ca5292dc9
11 changed files with 160 additions and 121 deletions

View File

@ -21,6 +21,7 @@ import (
type HTTPClient interface {
Call(method string, params map[string]interface{}, result interface{}) (interface{}, error)
Codec() *amino.Codec
SetCodec(*amino.Codec)
}
// TODO: Deprecate support for IP:PORT or /path/to/socket
@ -111,6 +112,10 @@ func (c *JSONRPCClient) Codec() *amino.Codec {
return c.cdc
}
func (c *JSONRPCClient) SetCodec(cdc *amino.Codec) {
c.cdc = cdc
}
//-------------------------------------------------------------
// URI takes params as a map
@ -152,6 +157,10 @@ func (c *URIClient) Codec() *amino.Codec {
return c.cdc
}
func (c *URIClient) SetCodec(cdc *amino.Codec) {
c.cdc = cdc
}
//------------------------------------------------
func unmarshalResponseBytes(cdc *amino.Codec, responseBytes []byte, result interface{}) (interface{}, error) {