orders: Add methods to derive SubmitResponse and Detail types (#955)

* orders: deprecate SubmitResponse return and change to *order.Detail construct detail from order.Submit struct

* orders: add coverage, fix tests

* coinut: rm test for checking

* orders: revert change for return and change field ID to a more explicit name OrderID

* orders: Add method to see if the order was placed

* order: change field name in Cancel type to be more explicit

* orders: standardize field -> OrderID

* backtester: populate change

* orders: add test

* gctscript: fix field name

* linter: fix issues

* linter: more fixes

* linter: forever

* exchanges_tests: populate order.Submit field exchange name

* Update exchanges/order/order_types.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/order/orders.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* glorious: nits

* thrasher: nits

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
Ryan O'Hara-Reid
2022-06-06 11:52:15 +10:00
committed by GitHub
parent 85da9b7166
commit a12cd3d733
95 changed files with 1377 additions and 1170 deletions

View File

@@ -143,7 +143,7 @@ func (f fExchange) GetFuturesPositions(_ context.Context, a asset.Item, cp curre
Fee: 1.337,
FeeAsset: currency.Code{},
Exchange: f.GetName(),
ID: "test",
OrderID: "test",
Side: order.Long,
Status: order.Open,
AssetType: a,
@@ -1827,20 +1827,14 @@ func TestGetManagedOrders(t *testing.T) {
}
o := order.Detail{
Price: 100000,
Amount: 0.002,
Exchange: "Binance",
InternalOrderID: "",
ID: "",
ClientOrderID: "",
AccountID: "",
ClientID: "",
WalletAddress: "",
Type: order.Limit,
Side: order.Sell,
Status: order.New,
AssetType: asset.Spot,
Pair: currency.NewPair(currency.BTC, currency.USDT),
Price: 100000,
Amount: 0.002,
Exchange: "Binance",
Type: order.Limit,
Side: order.Sell,
Status: order.New,
AssetType: asset.Spot,
Pair: currency.NewPair(currency.BTC, currency.USDT),
}
err = om.Add(&o)
if err != nil {