GetStorageAtArgs

This commit is contained in:
Taylor Gerring
2015-03-26 12:11:28 +01:00
parent 300d36b864
commit 9c4504dc41
3 changed files with 74 additions and 27 deletions

View File

@ -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