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
4391c382
Commit
4391c382
authored
Apr 01, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed getters on account objects. Closes #610
* GetCode * GetNonce * GetStorage * GetBalance
parent
344b3556
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
api.go
rpc/api.go
+1
-4
xeth.go
xeth/xeth.go
+4
-6
No files found.
rpc/api.go
View file @
4391c382
...
...
@@ -95,10 +95,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return
err
}
state
:=
api
.
xethAtStateNum
(
args
.
BlockNumber
)
.
State
()
.
SafeGet
(
args
.
Address
)
value
:=
state
.
StorageString
(
args
.
Key
)
*
reply
=
common
.
ToHex
(
value
.
Bytes
())
*
reply
=
api
.
xethAtStateNum
(
args
.
BlockNumber
)
.
StorageAt
(
args
.
Address
,
args
.
Key
)
case
"eth_getTransactionCount"
:
args
:=
new
(
GetTxCountArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
xeth/xeth.go
View file @
4391c382
...
...
@@ -308,21 +308,19 @@ func (self *XEth) NumberToHuman(balance string) string {
}
func
(
self
*
XEth
)
StorageAt
(
addr
,
storageAddr
string
)
string
{
storage
:=
self
.
State
()
.
SafeGet
(
addr
)
.
StorageString
(
storageAddr
)
return
common
.
ToHex
(
storage
.
Bytes
())
return
common
.
ToHex
(
self
.
State
()
.
state
.
GetState
(
common
.
HexToAddress
(
addr
),
common
.
HexToHash
(
storageAddr
)))
}
func
(
self
*
XEth
)
BalanceAt
(
addr
string
)
string
{
return
self
.
State
()
.
SafeGet
(
addr
)
.
Balance
(
)
.
String
()
return
self
.
State
()
.
state
.
GetBalance
(
common
.
HexToAddress
(
addr
)
)
.
String
()
}
func
(
self
*
XEth
)
TxCountAt
(
address
string
)
int
{
return
int
(
self
.
State
()
.
SafeGet
(
address
)
.
Nonce
(
))
return
int
(
self
.
State
()
.
state
.
GetNonce
(
common
.
HexToAddress
(
address
)
))
}
func
(
self
*
XEth
)
CodeAt
(
address
string
)
string
{
return
common
.
ToHex
(
self
.
State
()
.
SafeGet
(
address
)
.
Code
(
))
return
common
.
ToHex
(
self
.
State
()
.
state
.
GetCode
(
common
.
HexToAddress
(
address
)
))
}
func
(
self
*
XEth
)
IsContract
(
address
string
)
bool
{
...
...
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