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
6cc02aad
Commit
6cc02aad
authored
Mar 19, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline getStateWithNum
parent
abc3d8d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
api.go
rpc/api.go
+4
-8
No files found.
rpc/api.go
View file @
6cc02aad
...
...
@@ -81,10 +81,6 @@ func (self *EthereumApi) xethWithStateNum(num int64) *xeth.XEth {
return
self
.
xeth
()
.
WithState
(
st
)
}
func
(
self
*
EthereumApi
)
getStateWithNum
(
num
int64
)
*
xeth
.
State
{
return
self
.
xethWithStateNum
(
num
)
.
State
()
}
func
(
self
*
EthereumApi
)
start
()
{
timer
:=
time
.
NewTicker
(
filterTickerTime
)
done
:
...
...
@@ -290,8 +286,7 @@ func (p *EthereumApi) GetBalance(args *GetBalanceArgs, reply *interface{}) error
if
err
:=
args
.
requirements
();
err
!=
nil
{
return
err
}
state
:=
p
.
getStateWithNum
(
args
.
BlockNumber
)
.
SafeGet
(
args
.
Address
)
*
reply
=
common
.
ToHex
(
state
.
Balance
()
.
Bytes
())
*
reply
=
common
.
ToHex
(
p
.
xethWithStateNum
(
args
.
BlockNumber
)
.
State
()
.
SafeGet
(
args
.
Address
)
.
Balance
()
.
Bytes
())
return
nil
}
...
...
@@ -299,7 +294,7 @@ func (p *EthereumApi) GetStorage(args *GetStorageArgs, reply *interface{}) error
if
err
:=
args
.
requirements
();
err
!=
nil
{
return
err
}
*
reply
=
p
.
getStateWithNum
(
args
.
BlockNumber
)
.
SafeGet
(
args
.
Address
)
.
Storage
()
*
reply
=
p
.
xethWithStateNum
(
args
.
BlockNumber
)
.
State
(
)
.
SafeGet
(
args
.
Address
)
.
Storage
()
return
nil
}
...
...
@@ -307,9 +302,10 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) e
if
err
:=
args
.
requirements
();
err
!=
nil
{
return
err
}
state
:=
p
.
getStateWithNum
(
args
.
BlockNumber
)
.
SafeGet
(
args
.
Address
)
state
:=
p
.
xethWithStateNum
(
args
.
BlockNumber
)
.
State
()
.
SafeGet
(
args
.
Address
)
value
:=
state
.
StorageString
(
args
.
Key
)
var
hx
string
if
strings
.
Index
(
args
.
Key
,
"0x"
)
==
0
{
hx
=
string
([]
byte
(
args
.
Key
)[
2
:
])
...
...
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