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
d0c3f127
Commit
d0c3f127
authored
Apr 07, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More type fixes
parent
1aaeae29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
api.go
rpc/api.go
+9
-10
No files found.
rpc/api.go
View file @
d0c3f127
...
...
@@ -98,7 +98,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
count
:=
api
.
xethAtStateNum
(
args
.
BlockNumber
)
.
TxCountAt
(
args
.
Address
)
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
count
))
.
Bytes
())
*
reply
=
newHexNum
(
big
.
NewInt
(
int64
(
count
))
.
Bytes
())
case
"eth_getBlockTransactionCountByHash"
:
args
:=
new
(
HashArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
@@ -109,7 +109,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
if
block
==
nil
{
*
reply
=
nil
}
else
{
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
len
(
block
.
Transactions
)))
.
Bytes
())
*
reply
=
newHexNum
(
big
.
NewInt
(
int64
(
len
(
block
.
Transactions
)))
.
Bytes
())
}
case
"eth_getBlockTransactionCountByNumber"
:
args
:=
new
(
BlockNumArg
)
...
...
@@ -123,7 +123,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
break
}
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
len
(
block
.
Transactions
)))
.
Bytes
())
*
reply
=
newHexNum
(
big
.
NewInt
(
int64
(
len
(
block
.
Transactions
)))
.
Bytes
())
case
"eth_getUncleCountByBlockHash"
:
args
:=
new
(
HashArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
@@ -137,7 +137,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
break
}
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
len
(
br
.
Uncles
)))
.
Bytes
())
*
reply
=
newHexNum
(
big
.
NewInt
(
int64
(
len
(
br
.
Uncles
)))
.
Bytes
())
case
"eth_getUncleCountByBlockNumber"
:
args
:=
new
(
BlockNumArg
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
@@ -151,7 +151,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
break
}
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
len
(
br
.
Uncles
)))
.
Bytes
())
*
reply
=
newHexNum
(
big
.
NewInt
(
int64
(
len
(
br
.
Uncles
)))
.
Bytes
())
case
"eth_getData"
,
"eth_getCode"
:
args
:=
new
(
GetDataArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
@@ -305,14 +305,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
id
:=
api
.
xeth
()
.
RegisterFilter
(
args
.
Earliest
,
args
.
Latest
,
args
.
Skip
,
args
.
Max
,
args
.
Address
,
args
.
Topics
)
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
id
))
.
Bytes
())
*
reply
=
newHexNum
(
big
.
NewInt
(
int64
(
id
))
.
Bytes
())
case
"eth_newBlockFilter"
:
args
:=
new
(
FilterStringArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
return
err
}
id
:=
api
.
xeth
()
.
NewFilterString
(
args
.
Word
)
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
id
))
.
Bytes
())
*
reply
=
newHexNum
(
api
.
xeth
()
.
NewFilterString
(
args
.
Word
))
case
"eth_uninstallFilter"
:
args
:=
new
(
FilterIdArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
@@ -394,7 +393,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
res
,
_
:=
api
.
xeth
()
.
DbGet
([]
byte
(
args
.
Database
+
args
.
Key
))
*
reply
=
common
.
ToHex
(
res
)
*
reply
=
newHexData
(
res
)
case
"shh_version"
:
*
reply
=
api
.
xeth
()
.
WhisperVersion
()
case
"shh_post"
:
...
...
@@ -435,7 +434,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
opts
.
To
=
args
.
To
opts
.
Topics
=
args
.
Topics
id
:=
api
.
xeth
()
.
NewWhisperFilter
(
opts
)
*
reply
=
common
.
ToHex
(
big
.
NewInt
(
int64
(
id
))
.
Bytes
())
*
reply
=
newHexNum
(
big
.
NewInt
(
int64
(
id
))
.
Bytes
())
case
"shh_uninstallFilter"
:
args
:=
new
(
FilterIdArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
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