inline Transact
This commit is contained in:
parent
aa3918efa7
commit
b3329bc698
24
rpc/api.go
24
rpc/api.go
@ -43,19 +43,6 @@ func (self *EthereumApi) xeth() *xeth.XEth {
|
|||||||
return self.eth
|
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 {
|
func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) error {
|
||||||
if err := args.requirements(); err != nil {
|
if err := args.requirements(); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -231,7 +218,16 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
|
|||||||
if err := json.Unmarshal(req.Params, &args); err != nil {
|
if err := json.Unmarshal(req.Params, &args); err != nil {
|
||||||
return err
|
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":
|
case "eth_call":
|
||||||
args := new(NewTxArgs)
|
args := new(NewTxArgs)
|
||||||
if err := json.Unmarshal(req.Params, &args); err != nil {
|
if err := json.Unmarshal(req.Params, &args); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user