aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-26 19:11:28 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-26 19:11:28 +0800
commit9c4504dc41bbedb590db20519030224df66ce4b1 (patch)
treed5131e1b0301922783083dac1b3d837655b39986 /rpc/args.go
parent300d36b8640cf195db0f7997cc946ab5f164828f (diff)
downloadgo-tangerine-9c4504dc41bbedb590db20519030224df66ce4b1.tar
go-tangerine-9c4504dc41bbedb590db20519030224df66ce4b1.tar.gz
go-tangerine-9c4504dc41bbedb590db20519030224df66ce4b1.tar.bz2
go-tangerine-9c4504dc41bbedb590db20519030224df66ce4b1.tar.lz
go-tangerine-9c4504dc41bbedb590db20519030224df66ce4b1.tar.xz
go-tangerine-9c4504dc41bbedb590db20519030224df66ce4b1.tar.zst
go-tangerine-9c4504dc41bbedb590db20519030224df66ce4b1.zip
GetStorageAtArgs
Diffstat (limited to 'rpc/args.go')
-rw-r--r--rpc/args.go19
1 files changed, 4 insertions, 15 deletions
diff --git a/rpc/args.go b/rpc/args.go
index 82ee00d25..84c9ee0f7 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -184,8 +184,8 @@ func (args *GetStorageArgs) UnmarshalJSON(b []byte) (err error) {
}
type GetStorageAtArgs struct {
- Address string
- Key string
+ Address common.Address
+ Key common.Hash
BlockNumber int64
}
@@ -203,13 +203,13 @@ func (args *GetStorageAtArgs) UnmarshalJSON(b []byte) (err error) {
if !ok {
return NewDecodeParamError("Address is not a string")
}
- args.Address = addstr
+ args.Address = common.HexToAddress(addstr)
keystr, ok := obj[1].(string)
if !ok {
return NewDecodeParamError("Key is not a string")
}
- args.Key = keystr
+ args.Key = common.HexToHash(keystr)
if len(obj) > 2 {
if err := blockHeight(obj[2], &args.BlockNumber); err != nil {
@@ -220,17 +220,6 @@ func (args *GetStorageAtArgs) UnmarshalJSON(b []byte) (err error) {
return nil
}
-func (args *GetStorageAtArgs) requirements() error {
- if len(args.Address) == 0 {
- return NewValidationError("Address", "cannot be blank")
- }
-
- if len(args.Key) == 0 {
- return NewValidationError("Key", "cannot be blank")
- }
- return nil
-}
-
type GetTxCountArgs struct {
Address string
BlockNumber int64