mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Orders: Fix ClientOrderID not updated in merge (#1235)
This commit is contained in:
@@ -1091,6 +1091,7 @@ func TestUpdateOrderFromDetail(t *testing.T) {
|
||||
OrderID: "1",
|
||||
AccountID: "1",
|
||||
ClientID: "1",
|
||||
ClientOrderID: "DukeOfWombleton",
|
||||
WalletAddress: "1",
|
||||
Type: 1,
|
||||
Side: 1,
|
||||
@@ -1166,6 +1167,9 @@ func TestUpdateOrderFromDetail(t *testing.T) {
|
||||
if od.ClientID != "1" {
|
||||
t.Error("Failed to update")
|
||||
}
|
||||
if od.ClientOrderID != "DukeOfWombleton" {
|
||||
t.Error("Failed to update")
|
||||
}
|
||||
if od.WalletAddress != "1" {
|
||||
t.Error("Failed to update")
|
||||
}
|
||||
|
||||
@@ -184,6 +184,10 @@ func (d *Detail) UpdateOrderFromDetail(m *Detail) error {
|
||||
d.ClientID = m.ClientID
|
||||
updated = true
|
||||
}
|
||||
if m.ClientOrderID != "" && m.ClientOrderID != d.ClientOrderID {
|
||||
d.ClientOrderID = m.ClientOrderID
|
||||
updated = true
|
||||
}
|
||||
if m.WalletAddress != "" && m.WalletAddress != d.WalletAddress {
|
||||
d.WalletAddress = m.WalletAddress
|
||||
updated = true
|
||||
|
||||
Reference in New Issue
Block a user