(BUG FIX) Fix order submission crash due to missing "exchange" parameter (#468)

* fix the return problem

* fix the return problem

* add the mandatory parameter

* fix the symbol empity problem

* fix the symbol empty problem

* add Pair parameter for order.Cancel parameters

* follow the gofmt rule

Co-authored-by: MK <mk@MKdeMacBook-Pro.local>
This commit is contained in:
Harry Ma
2020-03-14 10:02:27 +08:00
committed by GitHub
parent 1deeca9953
commit 99e8d2f167

View File

@@ -804,7 +804,13 @@ func (s *RPCServer) SubmitOrder(ctx context.Context, r *gctrpc.SubmitOrderReques
Amount: r.Amount,
Price: r.Price,
ClientID: r.ClientId,
Exchange: r.Exchange,
})
if err != nil {
return &gctrpc.SubmitOrderResponse{}, err
}
return &gctrpc.SubmitOrderResponse{
OrderId: resp.OrderID,
OrderPlaced: resp.IsOrderPlaced,
@@ -898,6 +904,7 @@ func (s *RPCServer) CancelOrder(ctx context.Context, r *gctrpc.CancelOrderReques
ID: r.OrderId,
Side: order.Side(r.Side),
WalletAddress: r.WalletAddress,
Pair: currency.NewPairFromStrings(r.Pair.Base, r.Pair.Quote),
})
return &gctrpc.CancelOrderResponse{}, err