mirror of https://github.com/status-im/op-geth.git
inline WhisperPost
This commit is contained in:
parent
0895190b64
commit
cdfc03dc8e
18
rpc/api.go
18
rpc/api.go
|
@ -331,16 +331,6 @@ func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthereumApi) WhisperPost(args *WhisperMessageArgs, reply *interface{}) error {
|
|
||||||
err := p.xeth().Whisper().Post(args.Payload, args.To, args.From, args.Topics, args.Priority, args.Ttl)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
*reply = true
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *EthereumApi) GetBlockByHash(blockhash string, includetx bool) (*BlockRes, error) {
|
func (p *EthereumApi) GetBlockByHash(blockhash string, includetx bool) (*BlockRes, error) {
|
||||||
block := p.xeth().EthBlockByHash(blockhash)
|
block := p.xeth().EthBlockByHash(blockhash)
|
||||||
br := NewBlockRes(block)
|
br := NewBlockRes(block)
|
||||||
|
@ -659,7 +649,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.WhisperPost(args, reply)
|
|
||||||
|
err := p.xeth().Whisper().Post(args.Payload, args.To, args.From, args.Topics, args.Priority, args.Ttl)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
*reply = true
|
||||||
case "shh_newIdentity":
|
case "shh_newIdentity":
|
||||||
*reply = p.xeth().Whisper().NewIdentity()
|
*reply = p.xeth().Whisper().NewIdentity()
|
||||||
// case "shh_removeIdentity":
|
// case "shh_removeIdentity":
|
||||||
|
|
Loading…
Reference in New Issue