updated ethereum.js and moved to subfolder

* Previous subtree caused a lot of trouble
* Implemented sha3 in our shiny new http JSON RPC
This commit is contained in:
obscuren
2015-01-29 00:24:00 +01:00
parent 73dcbf7ba2
commit ec85458612
7 changed files with 140 additions and 3 deletions

View File

@ -56,6 +56,20 @@ type RpcRequest struct {
Params []json.RawMessage `json:"params"`
}
func (req *RpcRequest) ToSha3Args() (*Sha3Args, error) {
if len(req.Params) < 1 {
return nil, NewErrorResponse(ErrorArguments)
}
args := new(Sha3Args)
r := bytes.NewReader(req.Params[0])
if err := json.NewDecoder(r).Decode(args); err != nil {
return nil, NewErrorResponse(ErrorDecodeArgs)
}
rpclogger.DebugDetailf("%T %v", args, args)
return args, nil
}
func (req *RpcRequest) ToGetBlockArgs() (*GetBlockArgs, error) {
if len(req.Params) < 1 {
return nil, NewErrorResponse(ErrorArguments)