GetStorageArgs
This commit is contained in:
13
rpc/args.go
13
rpc/args.go
@ -149,7 +149,7 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
|
||||
}
|
||||
|
||||
type GetStorageArgs struct {
|
||||
Address string
|
||||
Address common.Address
|
||||
BlockNumber int64
|
||||
}
|
||||
|
||||
@ -165,9 +165,9 @@ func (args *GetStorageArgs) UnmarshalJSON(b []byte) (err error) {
|
||||
|
||||
addstr, ok := obj[0].(string)
|
||||
if !ok {
|
||||
return NewDecodeParamError("Address is not a string")
|
||||
return NewDecodeParamError("address is not a string")
|
||||
}
|
||||
args.Address = addstr
|
||||
args.Address = common.HexToAddress(addstr)
|
||||
|
||||
if len(obj) > 1 {
|
||||
if err := blockHeight(obj[1], &args.BlockNumber); err != nil {
|
||||
@ -178,13 +178,6 @@ func (args *GetStorageArgs) UnmarshalJSON(b []byte) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (args *GetStorageArgs) requirements() error {
|
||||
if len(args.Address) == 0 {
|
||||
return NewValidationError("Address", "cannot be blank")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetStorageAtArgs struct {
|
||||
Address string
|
||||
Key string
|
||||
|
Reference in New Issue
Block a user