diff options
author | Felix Lange <fjl@twurst.com> | 2016-07-12 23:47:15 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-07-23 05:21:27 +0800 |
commit | 91b769042857f542b2792b23ec407e1c9bd4fe8d (patch) | |
tree | f6730b3e85a7ac5ca98f9a716505349958fcacd3 /rpc/utils.go | |
parent | bb01bea4e276dad359815c682a2dee730737f4dc (diff) | |
download | dexon-91b769042857f542b2792b23ec407e1c9bd4fe8d.tar.gz dexon-91b769042857f542b2792b23ec407e1c9bd4fe8d.tar.zst dexon-91b769042857f542b2792b23ec407e1c9bd4fe8d.zip |
rpc: add new client, use it everywhere
The new client implementation supports concurrent requests,
subscriptions and replaces the various ad hoc RPC clients
throughout go-ethereum.
Diffstat (limited to 'rpc/utils.go')
-rw-r--r-- | rpc/utils.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/rpc/utils.go b/rpc/utils.go index fe482e19d..1ac6698f5 100644 --- a/rpc/utils.go +++ b/rpc/utils.go @@ -20,7 +20,6 @@ import ( "crypto/rand" "encoding/hex" "errors" - "fmt" "math/big" "reflect" "unicode" @@ -227,31 +226,3 @@ func newSubscriptionID() (string, error) { } return "0x" + hex.EncodeToString(subid[:]), nil } - -// SupportedModules returns the collection of API's that the RPC server offers -// on which the given client connects. -func SupportedModules(client Client) (map[string]string, error) { - req := JSONRequest{ - Id: []byte("1"), - Version: "2.0", - Method: MetadataApi + "_modules", - } - if err := client.Send(req); err != nil { - return nil, err - } - - var response JSONSuccessResponse - if err := client.Recv(&response); err != nil { - return nil, err - } - if response.Result != nil { - mods := make(map[string]string) - if modules, ok := response.Result.(map[string]interface{}); ok { - for m, v := range modules { - mods[m] = fmt.Sprintf("%s", v) - } - return mods, nil - } - } - return nil, fmt.Errorf("unable to retrieve modules") -} |