mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 07:26:53 +00:00
orders: Add derive modify struct method from order.Detail (#948)
* orders: Add derive modify struct method to order.Detail and then subsequent method to derive and standardize response details * exchanges: call modify method in wrappers * linter: fixes * engine/wsroutineman: remove print summary * glorious: nits, removed modifyOrder functionality for Bithumb. There are not docs to support this. * Update exchanges/order/orders.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * glorious: nits Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
@@ -83,10 +83,13 @@ func (f omfExchange) GetActiveOrders(ctx context.Context, req *order.GetOrdersRe
|
||||
}}, nil
|
||||
}
|
||||
|
||||
func (f omfExchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.Modify, error) {
|
||||
ans := *action
|
||||
ans.ID = "modified_order_id"
|
||||
return &ans, nil
|
||||
func (f omfExchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
|
||||
ans, err := action.DeriveModifyResponse()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ans.OrderID = "modified_order_id"
|
||||
return ans, nil
|
||||
}
|
||||
|
||||
func TestSetupOrderManager(t *testing.T) {
|
||||
@@ -317,12 +320,12 @@ func TestStore_modifyOrder(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
err = m.orderStore.modifyExisting("fake_order_id", &order.Modify{
|
||||
err = m.orderStore.modifyExisting("fake_order_id", &order.ModifyResponse{
|
||||
Exchange: testExchange,
|
||||
|
||||
ID: "another_fake_order_id",
|
||||
Price: 16,
|
||||
Amount: 256,
|
||||
OrderID: "another_fake_order_id",
|
||||
Price: 16,
|
||||
Amount: 256,
|
||||
})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
|
||||
Reference in New Issue
Block a user