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
39b8c83b
Commit
39b8c83b
authored
May 05, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Impelemented GetStorageAt
parent
4f20e8f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
packages.go
etherpc/packages.go
+12
-5
No files found.
etherpc/packages.go
View file @
39b8c83b
...
...
@@ -115,9 +115,6 @@ func (a *NewTxArgs) requirementsContract() error {
if
a
.
GasPrice
==
""
{
return
NewErrorResponse
(
"Create requires a 'gasprice' value as argument"
)
}
if
a
.
Init
==
""
{
return
NewErrorResponse
(
"Create requires a 'init' value as argument"
)
}
if
a
.
Body
==
""
{
return
NewErrorResponse
(
"Create requires a 'body' value as argument"
)
}
...
...
@@ -144,7 +141,8 @@ func (p *MainPackage) Create(args *NewTxArgs, reply *string) error {
return
nil
}
func
(
p
*
MainPackage
)
getKey
(
args
interface
{},
reply
*
string
)
error
{
func
(
p
*
MainPackage
)
GetKey
(
args
interface
{},
reply
*
string
)
error
{
*
reply
=
NewSuccessRes
(
p
.
ethp
.
GetKey
())
return
nil
}
...
...
@@ -163,11 +161,20 @@ func (a *GetStorageArgs) requirements() error {
return
nil
}
func
(
p
*
MainPackage
)
getStorageAt
(
args
*
GetStorageArgs
,
reply
*
string
)
error
{
type
GetStorageAtRes
struct
{
Key
string
`json:"key"`
Value
string
`json:"value"`
Address
string
`json:"address"`
}
func
(
p
*
MainPackage
)
GetStorageAt
(
args
*
GetStorageArgs
,
reply
*
string
)
error
{
err
:=
args
.
requirements
()
if
err
!=
nil
{
return
err
}
state
:=
p
.
ethp
.
GetStateObject
(
args
.
Address
)
value
:=
state
.
GetStorage
(
args
.
Key
)
*
reply
=
NewSuccessRes
(
&
GetStorageAtRes
{
Address
:
args
.
Address
,
Key
:
args
.
Key
,
Value
:
value
})
return
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