Commit 0ed57c0e authored by jiangpeng's avatar jiangpeng Committed by vipwzw

support parachain mempool getProperFee

parent c6ce13ef
...@@ -47,19 +47,23 @@ func (mem *Mempool) SetQueueClient(client queue.Client) { ...@@ -47,19 +47,23 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
go func() { go func() {
defer mem.wg.Done() defer mem.wg.Done()
for msg := range client.Recv() { for msg := range client.Recv() {
var err error
var reply interface{}
switch msg.Ty { switch msg.Ty {
case types.EventTx: case types.EventTx:
mlog.Info("Receive msg from para mempool") mlog.Info("Receive msg from para mempool")
tx := msg.GetData().(*types.Transaction) tx := msg.GetData().(*types.Transaction)
reply, err := mem.mainGrpcCli.SendTransaction(context.Background(), tx) reply, err = mem.mainGrpcCli.SendTransaction(context.Background(), tx)
if err != nil { case types.EventGetProperFee:
msg.Reply(client.NewMessage(mem.key, types.EventReply, err)) reply, err = mem.mainGrpcCli.GetProperFee(context.Background(), &types.ReqNil{})
} else {
msg.Reply(client.NewMessage(mem.key, types.EventReply, reply))
}
default: default:
msg.Reply(client.NewMessage(mem.key, types.EventReply, types.ErrActionNotSupport)) msg.Reply(client.NewMessage(mem.key, types.EventReply, types.ErrActionNotSupport))
} }
if err != nil {
msg.Reply(client.NewMessage(mem.key, types.EventReply, err))
} else {
msg.Reply(client.NewMessage(mem.key, types.EventReply, reply))
}
} }
}() }()
} }
......
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