Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
21282896
Commit
21282896
authored
9 years ago
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2171 from karalabe/rpc-modules-fix
rpc: add jsonrpc version to module request, use json types
parents
3274db19
6b939fbe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
api.go
eth/api.go
+1
-2
utils.go
rpc/utils.go
+7
-9
No files found.
eth/api.go
View file @
21282896
...
...
@@ -27,8 +27,6 @@ import (
"sync"
"time"
"gopkg.in/fatih/set.v0"
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
...
...
@@ -46,6 +44,7 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
"gopkg.in/fatih/set.v0"
)
const
(
...
...
This diff is collapsed.
Click to expand it.
rpc/utils.go
View file @
21282896
...
...
@@ -218,29 +218,27 @@ func newSubscriptionId() (string, error) {
// 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
:=
map
[
string
]
interface
{}{
"id"
:
1
,
"method"
:
"rpc_modules"
,
req
:=
JSONRequest
{
Id
:
new
(
int64
),
Version
:
"2.0"
,
Method
:
"rpc_modules"
,
}
if
err
:=
client
.
Send
(
req
);
err
!=
nil
{
return
nil
,
err
}
var
response
map
[
string
]
interface
{}
var
response
JSONSuccessResponse
if
err
:=
client
.
Recv
(
&
response
);
err
!=
nil
{
return
nil
,
err
}
if
payload
,
ok
:=
response
[
"result"
];
ok
{
if
response
.
Result
!=
nil
{
mods
:=
make
(
map
[
string
]
string
)
if
modules
,
ok
:=
payload
.
(
map
[
string
]
interface
{});
ok
{
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"
)
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment