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
739c36ad
Commit
739c36ad
authored
Mar 20, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inline GetStorageAt
parent
28e5fc83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
23 deletions
+8
-23
api.go
rpc/api.go
+8
-23
No files found.
rpc/api.go
View file @
739c36ad
...
...
@@ -4,7 +4,6 @@ import (
"encoding/json"
"math/big"
"path"
"strings"
"sync"
"github.com/ethereum/go-ethereum/common"
...
...
@@ -43,27 +42,6 @@ func (self *EthereumApi) xeth() *xeth.XEth {
return
self
.
eth
}
func
(
p
*
EthereumApi
)
GetStorageAt
(
args
*
GetStorageAtArgs
,
reply
*
interface
{})
error
{
if
err
:=
args
.
requirements
();
err
!=
nil
{
return
err
}
state
:=
p
.
xeth
()
.
AtStateNum
(
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
:
])
}
else
{
// Convert the incoming string (which is a bigint) into hex
i
,
_
:=
new
(
big
.
Int
)
.
SetString
(
args
.
Key
,
10
)
hx
=
common
.
Bytes2Hex
(
i
.
Bytes
())
}
rpclogger
.
Debugf
(
"GetStateAt(%s, %s)
\n
"
,
args
.
Address
,
hx
)
*
reply
=
map
[
string
]
string
{
args
.
Key
:
value
.
Str
()}
return
nil
}
// func (self *EthereumApi) Register(args string, reply *interface{}) error {
// self.regmut.Lock()
// defer self.regmut.Unlock()
...
...
@@ -159,7 +137,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
return
err
}
return
p
.
GetStorageAt
(
args
,
reply
)
if
err
:=
args
.
requirements
();
err
!=
nil
{
return
err
}
state
:=
p
.
xeth
()
.
AtStateNum
(
args
.
BlockNumber
)
.
State
()
.
SafeGet
(
args
.
Address
)
value
:=
state
.
StorageString
(
args
.
Key
)
*
reply
=
common
.
Bytes2Hex
(
value
.
Bytes
())
case
"eth_getTransactionCount"
:
args
:=
new
(
GetTxCountArgs
)
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