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