ninth version
Deploy / Test, build and deploy (push) Failing after 1m6s

This commit is contained in:
2026-06-08 14:25:44 +00:00
parent e8b7d8e27c
commit 20cc8506ad
21 changed files with 847 additions and 148 deletions
+18 -1
View File
@@ -62,7 +62,18 @@ func (g *PaperGateway) CancelOrder(ctx context.Context, accountID, orderID strin
}
func (g *PaperGateway) GetOrderState(ctx context.Context, accountID, orderID string) (domain.Order, error) {
return g.Fake().GetOrderState(ctx, accountID, orderID)
order, err := g.Fake().GetOrderState(ctx, accountID, orderID)
if err != nil {
return domain.Order{}, err
}
if !paperOrderCanFill(order) {
return order, nil
}
book, err := g.GetOrderBook(ctx, order.InstrumentUID, 20)
if err != nil {
return domain.Order{}, err
}
return g.Fake().SimulateOrderBookFill(orderID, book)
}
func (g *PaperGateway) GetActiveOrders(ctx context.Context, accountID string) ([]domain.Order, error) {
@@ -83,3 +94,9 @@ func (g *PaperGateway) GetServerTime(ctx context.Context) (time.Time, error) {
}
return g.Fake().GetServerTime(ctx)
}
func paperOrderCanFill(order domain.Order) bool {
return order.Status == domain.OrderStatusSent ||
order.Status == domain.OrderStatusPartiallyFilled ||
order.Status == domain.OrderStatusNew
}