diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 13:58:53 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 13:58:53 +0800 |
commit | e038a42d7a0e7e2c6ad7cef6c6446ad1e9454fe5 (patch) | |
tree | 8c980356ef3d53a08e65cc3db0928a8a8b560f85 /rpc/api.go | |
parent | 1d6451f5c390b13deb88d9a3878bb7d26d2797b8 (diff) | |
download | dexon-e038a42d7a0e7e2c6ad7cef6c6446ad1e9454fe5.tar.gz dexon-e038a42d7a0e7e2c6ad7cef6c6446ad1e9454fe5.tar.zst dexon-e038a42d7a0e7e2c6ad7cef6c6446ad1e9454fe5.zip |
inline Call
Diffstat (limited to 'rpc/api.go')
-rw-r--r-- | rpc/api.go | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/rpc/api.go b/rpc/api.go index 63e2a85dd..0596aee48 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -66,16 +66,6 @@ func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) (err error) return nil } -func (p *EthereumApi) Call(args *NewTxArgs, reply *interface{}) error { - result, err := p.xeth().AtStateNum(args.BlockNumber).Call(args.From, args.To, args.Value.String(), args.Gas.String(), args.GasPrice.String(), args.Data) - if err != nil { - return err - } - - *reply = result - return nil -} - func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) error { if err := args.requirements(); err != nil { return err @@ -257,7 +247,13 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error if err := json.Unmarshal(req.Params, &args); err != nil { return err } - return p.Call(args, reply) + + result, err := p.xeth().AtStateNum(args.BlockNumber).Call(args.From, args.To, args.Value.String(), args.Gas.String(), args.GasPrice.String(), args.Data) + if err != nil { + return err + } + + *reply = result case "eth_flush": return NewNotImplementedError(req.Method) case "eth_getBlockByHash": |