Commit 6fef6168 authored by Taylor Gerring's avatar Taylor Gerring

inline DbPut

parent d28cd0f0
...@@ -303,16 +303,6 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) e ...@@ -303,16 +303,6 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageAtArgs, reply *interface{}) e
return nil return nil
} }
func (p *EthereumApi) DbPut(args *DbArgs, reply *interface{}) error {
if err := args.requirements(); err != nil {
return err
}
p.db.Put([]byte(args.Database+args.Key), []byte(args.Value))
*reply = true
return nil
}
func (p *EthereumApi) DbGet(args *DbArgs, reply *interface{}) error { func (p *EthereumApi) DbGet(args *DbArgs, reply *interface{}) error {
if err := args.requirements(); err != nil { if err := args.requirements(); err != nil {
return err return err
...@@ -711,7 +701,13 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error ...@@ -711,7 +701,13 @@ 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.DbPut(args, reply)
if err := args.requirements(); err != nil {
return err
}
p.db.Put([]byte(args.Database+args.Key), []byte(args.Value))
*reply = true
case "db_getString": case "db_getString":
args := new(DbArgs) args := new(DbArgs)
if err := json.Unmarshal(req.Params, &args); err != nil { if err := json.Unmarshal(req.Params, &args); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment