Skip to content

Commit 23da40f

Browse files
authored
Merge pull request #2387 from c9s/dboy/fix/created-order
FIX: [exchange] retains amount field even when quote currency is empty
2 parents d8e8cdd + 51ed1cd commit 23da40f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/types/order.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (o *SubmitOrder) SlackAttachment() slack.Attachment {
285285
}
286286

287287
func (o *SubmitOrder) amountField() *slack.AttachmentField {
288-
if o.Price.Sign() < 0 || o.Quantity.Sign() < 0 || len(o.Market.QuoteCurrency) == 0 {
288+
if o.Price.Sign() < 0 || o.Quantity.Sign() < 0 {
289289
return nil
290290
}
291291
if currency.IsFiatCurrency(o.Market.QuoteCurrency) {
@@ -295,6 +295,8 @@ func (o *SubmitOrder) amountField() *slack.AttachmentField {
295295
Short: true,
296296
}
297297
}
298+
299+
// NOTE: o.Market.QuoteCurrency might be empty
298300
return &slack.AttachmentField{
299301
Title: "Amount",
300302
Value: fmt.Sprintf("%s %s", o.Price.Mul(o.Quantity).String(), o.Market.QuoteCurrency),

0 commit comments

Comments
 (0)