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
0f3bf7ef
Commit
0f3bf7ef
authored
Apr 02, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for balance
parent
7e13ee60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
api.go
rpc/api.go
+4
-3
xeth.go
xeth/xeth.go
+1
-1
No files found.
rpc/api.go
View file @
0f3bf7ef
...
@@ -36,7 +36,7 @@ func (api *EthereumApi) xethAtStateNum(num int64) *xeth.XEth {
...
@@ -36,7 +36,7 @@ func (api *EthereumApi) xethAtStateNum(num int64) *xeth.XEth {
func
(
api
*
EthereumApi
)
GetRequestReply
(
req
*
RpcRequest
,
reply
*
interface
{})
error
{
func
(
api
*
EthereumApi
)
GetRequestReply
(
req
*
RpcRequest
,
reply
*
interface
{})
error
{
// Spec at https://github.com/ethereum/wiki/wiki/JSON-RPC
// Spec at https://github.com/ethereum/wiki/wiki/JSON-RPC
rpclogger
.
Debug
f
(
"%s %s"
,
req
.
Method
,
req
.
Params
)
rpclogger
.
Info
f
(
"%s %s"
,
req
.
Method
,
req
.
Params
)
switch
req
.
Method
{
switch
req
.
Method
{
case
"web3_sha3"
:
case
"web3_sha3"
:
...
@@ -80,8 +80,9 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -80,8 +80,9 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return
err
return
err
}
}
v
:=
api
.
xethAtStateNum
(
args
.
BlockNumber
)
.
State
()
.
SafeGet
(
args
.
Address
)
.
Balance
()
*
reply
=
api
.
xethAtStateNum
(
args
.
BlockNumber
)
.
BalanceAt
(
args
.
Address
)
*
reply
=
common
.
ToHex
(
v
.
Bytes
())
//v := api.xethAtStateNum(args.BlockNumber).State().SafeGet(args.Address).Balance()
//*reply = common.ToHex(v.Bytes())
case
"eth_getStorage"
,
"eth_storageAt"
:
case
"eth_getStorage"
,
"eth_storageAt"
:
args
:=
new
(
GetStorageArgs
)
args
:=
new
(
GetStorageArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
xeth/xeth.go
View file @
0f3bf7ef
...
@@ -312,7 +312,7 @@ func (self *XEth) StorageAt(addr, storageAddr string) string {
...
@@ -312,7 +312,7 @@ func (self *XEth) StorageAt(addr, storageAddr string) string {
}
}
func
(
self
*
XEth
)
BalanceAt
(
addr
string
)
string
{
func
(
self
*
XEth
)
BalanceAt
(
addr
string
)
string
{
return
self
.
State
()
.
state
.
GetBalance
(
common
.
HexToAddress
(
addr
))
.
String
(
)
return
common
.
ToHex
(
self
.
State
()
.
state
.
GetBalance
(
common
.
HexToAddress
(
addr
))
.
Bytes
()
)
}
}
func
(
self
*
XEth
)
TxCountAt
(
address
string
)
int
{
func
(
self
*
XEth
)
TxCountAt
(
address
string
)
int
{
...
...
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