From 38f9b511ae7b920005648b826b22bbfcc00fca19 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 29 Apr 2020 18:17:18 +0300 Subject: [PATCH] rpc/client: drop Version from Options It makes no sense at all, it's a JSON-RPC version. --- pkg/rpc/client/client.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/rpc/client/client.go b/pkg/rpc/client/client.go index deb4e3f6b..a6d092a9f 100644 --- a/pkg/rpc/client/client.go +++ b/pkg/rpc/client/client.go @@ -32,7 +32,6 @@ type Client struct { cli *http.Client endpoint *url.URL ctx context.Context - version string wifMu *sync.Mutex wif *keys.WIF balancer request.BalanceGetter @@ -56,10 +55,6 @@ type Options struct { CACert string DialTimeout time.Duration RequestTimeout time.Duration - // Version is the version of the client that will be send - // along with the request body. If no version is specified - // the default version (currently 2.0) will be used. - Version string } // New returns a new Client ready to use. @@ -77,10 +72,6 @@ func New(ctx context.Context, endpoint string, opts Options) (*Client, error) { opts.RequestTimeout = defaultRequestTimeout } - if opts.Version == "" { - opts.Version = defaultClientVersion - } - httpClient := &http.Client{ Transport: &http.Transport{ DialContext: (&net.Dialer{ @@ -99,7 +90,6 @@ func New(ctx context.Context, endpoint string, opts Options) (*Client, error) { cli: httpClient, wifMu: new(sync.Mutex), endpoint: url, - version: opts.Version, } if opts.Balancer == nil { opts.Balancer = cl @@ -157,7 +147,7 @@ func (c *Client) CalculateInputs(address string, asset util.Uint256, cost util.F func (c *Client) performRequest(method string, p request.RawParams, v interface{}) error { var ( r = request.Raw{ - JSONRPC: c.version, + JSONRPC: request.JSONRPCVersion, Method: method, RawParams: p.Values, ID: 1,