diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 14:15:34 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 14:15:34 +0800 |
commit | b3329bc698722881b636af882df67eff79822da4 (patch) | |
tree | 50f1a08db2521a3e81ee0df77548fe3ae0e9ae25 | |
parent | aa3918efa711a51c241a70d675b27fc0f0c01ec3 (diff) | |
download | dexon-b3329bc698722881b636af882df67eff79822da4.tar dexon-b3329bc698722881b636af882df67eff79822da4.tar.gz dexon-b3329bc698722881b636af882df67eff79822da4.tar.bz2 dexon-b3329bc698722881b636af882df67eff79822da4.tar.lz dexon-b3329bc698722881b636af882df67eff79822da4.tar.xz dexon-b3329bc698722881b636af882df67eff79822da4.tar.zst dexon-b3329bc698722881b636af882df67eff79822da4.zip |
inline Transact
-rw-r--r-- | rpc/api.go | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/rpc/api.go b/rpc/api.go index 20b586686..3b60d661b 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -43,19 +43,6 @@ func (self *EthereumApi) xeth() *xeth.XEth { return self.eth } -func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) (err error) { - if err := args.requirements(); err != nil { - return err - } - - *reply, err = p.xeth().Transact(args.From, args.To, args.Value.String(), args.Gas.String(), args.GasPrice.String(), args.Data) - if err != nil { - return err - } - - return nil -} - func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) error { if err := args.requirements(); err != nil { return err @@ -231,7 +218,16 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error if err := json.Unmarshal(req.Params, &args); err != nil { return err } - return p.Transact(args, reply) + + if err := args.requirements(); err != nil { + return err + } + + v, err := p.xeth().Transact(args.From, args.To, args.Value.String(), args.Gas.String(), args.GasPrice.String(), args.Data) + if err != nil { + return err + } + *reply = v case "eth_call": args := new(NewTxArgs) if err := json.Unmarshal(req.Params, &args); err != nil { |