From 6d012f628bbfc22b2587828968eff513dfeb4d8e Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 29 Jan 2015 12:01:51 +0100 Subject: implement transact --- rpc/packages.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'rpc/packages.go') diff --git a/rpc/packages.go b/rpc/packages.go index 2c5fbf6be..11a172bd6 100644 --- a/rpc/packages.go +++ b/rpc/packages.go @@ -67,7 +67,8 @@ func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) error { if err != nil { return err } - result, _ := p.xeth.Transact( /* TODO specify account */ args.Recipient, args.Value, args.Gas, args.GasPrice, args.Body) + result, _ := p.xeth.Transact( /* TODO specify account */ args.Recipient, args.Value, args.Gas, args.GasPrice, args.Data) + fmt.Println("result:", result) *reply = result return nil } @@ -78,7 +79,7 @@ func (p *EthereumApi) Create(args *NewTxArgs, reply *interface{}) error { return err } - result, _ := p.xeth.Transact( /* TODO specify account */ "", args.Value, args.Gas, args.GasPrice, args.Body) + result, _ := p.xeth.Transact( /* TODO specify account */ "", args.Value, args.Gas, args.GasPrice, args.Data) *reply = result return nil } @@ -210,6 +211,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error return err } return p.GetBlock(args, reply) + case "eth_transact": + args, err := req.ToNewTxArgs() + if err != nil { + return err + } + return p.Transact(args, reply) case "web3_sha3": args, err := req.ToSha3Args() if err != nil { -- cgit