good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
9f5e9eb3
Commit
9f5e9eb3
authored
Mar 5, 2015
by
Taylor Gerring
Browse files
Options
Downloads
Patches
Plain Diff
Resolve storage/storageat
parent
a6599404
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
rpc/api.go
+5
-5
5 additions, 5 deletions
rpc/api.go
rpc/args.go
+3
-3
3 additions, 3 deletions
rpc/args.go
rpc/messages.go
+16
-8
16 additions, 8 deletions
rpc/messages.go
with
24 additions
and
16 deletions
rpc/api.go
+
5
−
5
View file @
9f5e9eb3
...
@@ -311,7 +311,7 @@ func (p *EthereumApi) PushTx(args *PushTxArgs, reply *interface{}) error {
...
@@ -311,7 +311,7 @@ func (p *EthereumApi) PushTx(args *PushTxArgs, reply *interface{}) error {
return
nil
return
nil
}
}
func
(
p
*
EthereumApi
)
GetSt
at
eAt
(
args
*
GetSt
ate
Args
,
reply
*
interface
{})
error
{
func
(
p
*
EthereumApi
)
GetSt
orag
eAt
(
args
*
GetSt
orageAt
Args
,
reply
*
interface
{})
error
{
err
:=
args
.
requirements
()
err
:=
args
.
requirements
()
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -333,7 +333,7 @@ func (p *EthereumApi) GetStateAt(args *GetStateArgs, reply *interface{}) error {
...
@@ -333,7 +333,7 @@ func (p *EthereumApi) GetStateAt(args *GetStateArgs, reply *interface{}) error {
return
nil
return
nil
}
}
func
(
p
*
EthereumApi
)
GetStorage
At
(
args
*
GetStorageArgs
,
reply
*
interface
{})
error
{
func
(
p
*
EthereumApi
)
GetStorage
(
args
*
GetStorageArgs
,
reply
*
interface
{})
error
{
err
:=
args
.
requirements
()
err
:=
args
.
requirements
()
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -527,14 +527,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
...
@@ -527,14 +527,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
p
.
GetBalanceAt
(
args
,
reply
)
return
p
.
GetBalanceAt
(
args
,
reply
)
case
"eth_getStorage"
:
case
"eth_getStorage"
:
// TODO handle defaultBlock
// TODO handle defaultBlock
args
,
err
:=
req
.
To
GetStat
eArgs
()
args
,
err
:=
req
.
To
Storag
eArgs
()
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
return
p
.
GetSt
ateAt
(
args
,
reply
)
return
p
.
GetSt
orage
(
args
,
reply
)
case
"eth_getStorageAt"
:
case
"eth_getStorageAt"
:
// TODO handle defaultBlock
// TODO handle defaultBlock
args
,
err
:=
req
.
ToStorageAtArgs
()
args
,
err
:=
req
.
To
Get
StorageAtArgs
()
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
This diff is collapsed.
Click to expand it.
rpc/args.go
+
3
−
3
View file @
9f5e9eb3
...
@@ -102,12 +102,12 @@ func (a *GetStorageArgs) requirements() error {
...
@@ -102,12 +102,12 @@ func (a *GetStorageArgs) requirements() error {
return
nil
return
nil
}
}
type
GetSt
ate
Args
struct
{
type
GetSt
orageAt
Args
struct
{
Address
string
Address
string
Key
string
Key
string
}
}
func
(
obj
*
GetSt
ate
Args
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
func
(
obj
*
GetSt
orageAt
Args
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
arg0
:=
""
arg0
:=
""
if
err
=
json
.
Unmarshal
(
b
,
&
arg0
);
err
==
nil
{
if
err
=
json
.
Unmarshal
(
b
,
&
arg0
);
err
==
nil
{
obj
.
Address
=
arg0
obj
.
Address
=
arg0
...
@@ -116,7 +116,7 @@ func (obj *GetStateArgs) UnmarshalJSON(b []byte) (err error) {
...
@@ -116,7 +116,7 @@ func (obj *GetStateArgs) UnmarshalJSON(b []byte) (err error) {
return
errDecodeArgs
return
errDecodeArgs
}
}
func
(
a
*
GetSt
ate
Args
)
requirements
()
error
{
func
(
a
*
GetSt
orageAt
Args
)
requirements
()
error
{
if
a
.
Address
==
""
{
if
a
.
Address
==
""
{
return
NewErrorWithMessage
(
errArguments
,
"GetStorageAt requires an 'address' value as argument"
)
return
NewErrorWithMessage
(
errArguments
,
"GetStorageAt requires an 'address' value as argument"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
rpc/messages.go
+
16
−
8
View file @
9f5e9eb3
...
@@ -120,23 +120,31 @@ func (req *RpcRequest) ToPushTxArgs() (*PushTxArgs, error) {
...
@@ -120,23 +120,31 @@ func (req *RpcRequest) ToPushTxArgs() (*PushTxArgs, error) {
return
args
,
nil
return
args
,
nil
}
}
func
(
req
*
RpcRequest
)
ToGetSt
ate
Args
()
(
*
GetSt
ate
Args
,
error
)
{
func
(
req
*
RpcRequest
)
ToGetSt
orageAt
Args
()
(
*
GetSt
orageAt
Args
,
error
)
{
if
len
(
req
.
Params
)
<
1
{
if
len
(
req
.
Params
)
<
2
{
return
nil
,
errArguments
return
nil
,
errArguments
}
}
args
:=
new
(
GetSt
ate
Args
)
args
:=
new
(
GetSt
orageAt
Args
)
// TODO need to pass both arguments
var
arg0
,
arg1
string
r
:=
bytes
.
NewReader
(
req
.
Params
[
0
])
er
r
:=
json
.
NewDecoder
(
r
)
.
Decode
(
args
)
r
0
:=
bytes
.
NewReader
(
req
.
Params
[
0
]
)
if
err
!=
nil
{
if
err
:=
json
.
NewDecoder
(
r0
)
.
Decode
(
arg0
);
err
!=
nil
{
return
nil
,
errDecodeArgs
return
nil
,
errDecodeArgs
}
}
r1
:=
bytes
.
NewReader
(
req
.
Params
[
1
])
if
err
:=
json
.
NewDecoder
(
r1
)
.
Decode
(
arg1
);
err
!=
nil
{
return
nil
,
errDecodeArgs
}
args
.
Address
=
arg0
args
.
Key
=
arg1
return
args
,
nil
return
args
,
nil
}
}
func
(
req
*
RpcRequest
)
ToStorageA
tA
rgs
()
(
*
GetStorageArgs
,
error
)
{
func
(
req
*
RpcRequest
)
ToStorageArgs
()
(
*
GetStorageArgs
,
error
)
{
if
len
(
req
.
Params
)
<
1
{
if
len
(
req
.
Params
)
<
1
{
return
nil
,
errArguments
return
nil
,
errArguments
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment