Skip to content
forked from c9s/bbgo

Commit

Permalink
max: remove legacy emptyTime
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Aug 5, 2024
1 parent 5d65b81 commit e03ba63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions pkg/exchange/max/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{
Expand All @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/strategy/xalign/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit e03ba63

Please sign in to comment.