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
9e0ab22d
Commit
9e0ab22d
authored
Feb 25, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub defaultBlock methods
parent
52ccaa60
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
api.go
rpc/api.go
+21
-0
messages.go
rpc/messages.go
+13
-0
No files found.
rpc/api.go
View file @
9e0ab22d
...
@@ -45,6 +45,8 @@ type EthereumApi struct {
...
@@ -45,6 +45,8 @@ type EthereumApi struct {
register
map
[
string
][]
*
NewTxArgs
register
map
[
string
][]
*
NewTxArgs
db
ethutil
.
Database
db
ethutil
.
Database
defaultBlockAge
int
}
}
func
NewEthereumApi
(
eth
*
xeth
.
XEth
)
*
EthereumApi
{
func
NewEthereumApi
(
eth
*
xeth
.
XEth
)
*
EthereumApi
{
...
@@ -318,6 +320,17 @@ func (p *EthereumApi) SetMining(shouldmine bool, reply *interface{}) error {
...
@@ -318,6 +320,17 @@ func (p *EthereumApi) SetMining(shouldmine bool, reply *interface{}) error {
return
nil
return
nil
}
}
func
(
p
*
EthereumApi
)
GetDefaultBlockAge
(
reply
*
interface
{})
error
{
*
reply
=
p
.
defaultBlockAge
return
nil
}
func
(
p
*
EthereumApi
)
SetDefaultBlockAge
(
defaultBlockAge
int
,
reply
*
interface
{})
error
{
p
.
defaultBlockAge
=
defaultBlockAge
*
reply
=
true
return
nil
}
func
(
p
*
EthereumApi
)
BlockNumber
(
reply
*
interface
{})
error
{
func
(
p
*
EthereumApi
)
BlockNumber
(
reply
*
interface
{})
error
{
*
reply
=
p
.
xeth
.
Backend
()
.
ChainManager
()
.
CurrentBlock
()
.
Number
()
*
reply
=
p
.
xeth
.
Backend
()
.
ChainManager
()
.
CurrentBlock
()
.
Number
()
return
nil
return
nil
...
@@ -458,6 +471,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
...
@@ -458,6 +471,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
return
err
}
}
return
p
.
SetMining
(
args
,
reply
)
return
p
.
SetMining
(
args
,
reply
)
case
"eth_defaultBlock"
:
return
p
.
GetDefaultBlockAge
(
reply
)
case
"eth_setDefaultBlock"
:
args
,
err
:=
req
.
ToIntArgs
()
if
err
!=
nil
{
return
err
}
return
p
.
SetDefaultBlockAge
(
args
,
reply
)
case
"eth_peerCount"
:
case
"eth_peerCount"
:
return
p
.
GetPeerCount
(
reply
)
return
p
.
GetPeerCount
(
reply
)
case
"eth_number"
:
case
"eth_number"
:
...
...
rpc/messages.go
View file @
9e0ab22d
...
@@ -210,6 +210,19 @@ func (req *RpcRequest) ToBoolArgs() (bool, error) {
...
@@ -210,6 +210,19 @@ func (req *RpcRequest) ToBoolArgs() (bool, error) {
return
args
,
nil
return
args
,
nil
}
}
func
(
req
*
RpcRequest
)
ToIntArgs
()
(
int
,
error
)
{
if
len
(
req
.
Params
)
<
1
{
return
0
,
errArguments
}
var
args
int
if
err
:=
json
.
Unmarshal
(
req
.
Params
[
0
],
&
args
);
err
!=
nil
{
return
0
,
errArguments
}
return
args
,
nil
}
func
(
req
*
RpcRequest
)
ToCompileArgs
()
(
string
,
error
)
{
func
(
req
*
RpcRequest
)
ToCompileArgs
()
(
string
,
error
)
{
if
len
(
req
.
Params
)
<
1
{
if
len
(
req
.
Params
)
<
1
{
return
""
,
errArguments
return
""
,
errArguments
...
...
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