|
|
@ -348,13 +348,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error |
|
|
|
opts := toFilterOptions(args) |
|
|
|
opts := toFilterOptions(args) |
|
|
|
*reply = NewLogsRes(p.xeth().AllLogs(opts)) |
|
|
|
*reply = NewLogsRes(p.xeth().AllLogs(opts)) |
|
|
|
case "eth_getWork": |
|
|
|
case "eth_getWork": |
|
|
|
*reply = p.getWork() |
|
|
|
p.xeth().SetMining(true) |
|
|
|
|
|
|
|
*reply = p.agent.GetWork().Hex() |
|
|
|
case "eth_submitWork": |
|
|
|
case "eth_submitWork": |
|
|
|
// TODO what is the reply here?
|
|
|
|
args := new(SubmitWorkArgs) |
|
|
|
// TODO what are the arguments?
|
|
|
|
if err := json.Unmarshal(req.Params, &args); err != nil { |
|
|
|
p.agent.SetResult(0, common.Hash{}, common.Hash{}) |
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
return NewNotImplementedError(req.Method) |
|
|
|
*reply = p.agent.SetResult(args.Nonce, args.Digest, args.Header) |
|
|
|
case "db_putString": |
|
|
|
case "db_putString": |
|
|
|
args := new(DbArgs) |
|
|
|
args := new(DbArgs) |
|
|
|
if err := json.Unmarshal(req.Params, &args); err != nil { |
|
|
|
if err := json.Unmarshal(req.Params, &args); err != nil { |
|
|
@ -466,11 +467,6 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (p *EthereumApi) getWork() string { |
|
|
|
|
|
|
|
p.xeth().SetMining(true) |
|
|
|
|
|
|
|
return p.agent.GetWork().Hex() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func toFilterOptions(options *BlockFilterArgs) *core.FilterOptions { |
|
|
|
func toFilterOptions(options *BlockFilterArgs) *core.FilterOptions { |
|
|
|
var opts core.FilterOptions |
|
|
|
var opts core.FilterOptions |
|
|
|
|
|
|
|
|
|
|
|