From e03ba63e440f6b1978883f8d5b04bd9525ba1c41 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 5 Aug 2024 16:40:10 +0800 Subject: [PATCH] max: remove legacy emptyTime --- pkg/exchange/max/exchange.go | 12 +++++------- pkg/strategy/xalign/strategy.go | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index ce52d09da..3852aadf5 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -824,8 +824,7 @@ func (e *Exchange) QueryWithdrawHistory( limit := 1000 txIDs := map[string]struct{}{} - emptyTime := time.Time{} - if startTime == emptyTime { + if startTime.IsZero() { startTime, err = e.getLaunchDate() if err != nil { return nil, err @@ -867,7 +866,7 @@ func (e *Exchange) QueryWithdrawHistory( } // we can convert this later - status := convertWithdrawStatus(d.State) + status := convertWithdrawStatusV3(d.Status) txIDs[d.TxID] = struct{}{} withdraw := types.Withdraw{ @@ -881,11 +880,10 @@ func (e *Exchange) QueryWithdrawHistory( TransactionFee: d.Fee, TransactionFeeCurrency: d.FeeCurrency, Network: d.NetworkProtocol, - // WithdrawOrderID: d.WithdrawOrderID, - // Network: d.Network, - Status: status, - OriginalStatus: string(d.State), + Status: status, + OriginalStatus: string(d.State), } + allWithdraws = append(allWithdraws, withdraw) } diff --git a/pkg/strategy/xalign/strategy.go b/pkg/strategy/xalign/strategy.go index 73496b1eb..7f5c66e79 100644 --- a/pkg/strategy/xalign/strategy.go +++ b/pkg/strategy/xalign/strategy.go @@ -146,7 +146,7 @@ func (s *Strategy) detectActiveWithdraw( for _, withdraw := range withdraws { switch withdraw.Status { - case types.WithdrawStatusProcessing, types.WithdrawStatusSent, types.WithdrawStatusAwaitingApproval: + case types.WithdrawStatusSent, types.WithdrawStatusProcessing, types.WithdrawStatusAwaitingApproval: return &withdraw, nil } }