aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/utils.go
diff options
context:
space:
mode:
authorbas-vk <bas-vk@users.noreply.github.com>2016-07-25 16:07:05 +0800
committerGitHub <noreply@github.com>2016-07-25 16:07:05 +0800
commit771655e3fee585ce4bc47dfaa279557c6c1c2421 (patch)
tree9071e157a54c40f06f0e5895643c82ca9a0b037a /rpc/utils.go
parent60cd5bf9397bd8331bce3bb1884524d43c31dbb5 (diff)
parent91b769042857f542b2792b23ec407e1c9bd4fe8d (diff)
downloadgo-tangerine-771655e3fee585ce4bc47dfaa279557c6c1c2421.tar
go-tangerine-771655e3fee585ce4bc47dfaa279557c6c1c2421.tar.gz
go-tangerine-771655e3fee585ce4bc47dfaa279557c6c1c2421.tar.bz2
go-tangerine-771655e3fee585ce4bc47dfaa279557c6c1c2421.tar.lz
go-tangerine-771655e3fee585ce4bc47dfaa279557c6c1c2421.tar.xz
go-tangerine-771655e3fee585ce4bc47dfaa279557c6c1c2421.tar.zst
go-tangerine-771655e3fee585ce4bc47dfaa279557c6c1c2421.zip
Merge pull request #2808 from fjl/rpc-client-3
rpc: add new client, use it everywhere
Diffstat (limited to 'rpc/utils.go')
-rw-r--r--rpc/utils.go29
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")
-}