Skip to content

Commit

Permalink
Fix return result type for Version(Async) RPCs. (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Nov 10, 2016
1 parent c872526 commit e0f7ad3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extensions.go
Expand Up @@ -1034,20 +1034,20 @@ type FutureVersionResult chan *response

// Receive waits for the response promised by the future and returns the version
// result.
func (r FutureVersionResult) Receive() (*dcrjson.VersionResult, error) {
func (r FutureVersionResult) Receive() (map[string]dcrjson.VersionResult, error) {
res, err := receiveFuture(r)
if err != nil {
return nil, err
}

// Unmarsal result as a version result object.
var vr dcrjson.VersionResult
var vr map[string]dcrjson.VersionResult
err = json.Unmarshal(res, &vr)
if err != nil {
return nil, err
}

return &vr, nil
return vr, nil
}

// VersionAsync returns an instance of a type that can be used to get the result
Expand All @@ -1060,6 +1060,6 @@ func (c *Client) VersionAsync() FutureVersionResult {
}

// Version returns information about the server's JSON-RPC API versions.
func (c *Client) Version() (*dcrjson.VersionResult, error) {
func (c *Client) Version() (map[string]dcrjson.VersionResult, error) {
return c.VersionAsync().Receive()
}

0 comments on commit e0f7ad3

Please sign in to comment.