aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 14:15:34 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 14:15:34 +0800
commitb3329bc698722881b636af882df67eff79822da4 (patch)
tree50f1a08db2521a3e81ee0df77548fe3ae0e9ae25 /rpc
parentaa3918efa711a51c241a70d675b27fc0f0c01ec3 (diff)
downloadgo-tangerine-b3329bc698722881b636af882df67eff79822da4.tar
go-tangerine-b3329bc698722881b636af882df67eff79822da4.tar.gz
go-tangerine-b3329bc698722881b636af882df67eff79822da4.tar.bz2
go-tangerine-b3329bc698722881b636af882df67eff79822da4.tar.lz
go-tangerine-b3329bc698722881b636af882df67eff79822da4.tar.xz
go-tangerine-b3329bc698722881b636af882df67eff79822da4.tar.zst
go-tangerine-b3329bc698722881b636af882df67eff79822da4.zip
inline Transact
Diffstat (limited to 'rpc')
-rw-r--r--rpc/api.go24
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 {