Commit 5fdf72b1 authored by Bas van Kervel's avatar Bas van Kervel

fixed web3 rpc test failures

parent c3f6c322
package api
import (
"encoding/json"
"github.com/ethereum/go-ethereum/rpc/shared"
)
type Sha3Args struct {
Data string
}
func (args *Sha3Args) UnmarshalJSON(b []byte) (err error) {
var obj []interface{}
if err := json.Unmarshal(b, &obj); err != nil {
return shared.NewDecodeParamError(err.Error())
}
if len(obj) < 1 {
return shared.NewInsufficientParamsError(len(obj), 1)
}
argstr, ok := obj[0].(string)
if !ok {
return shared.NewInvalidTypeError("data", "is not a string")
}
args.Data = argstr
return nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment