move local func

This commit is contained in:
c9s 2024-11-15 16:35:38 +08:00
parent 8922ed78bf
commit e26156d77b
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -913,6 +913,14 @@ func (e *Exchange) QueryDepositHistory(
}
}
toRawStatusStr := func(d maxapi.Deposit) string {
if len(d.StateReason) > 0 {
return fmt.Sprintf("%s (%s: %s)", d.Status, d.State, d.StateReason)
}
return fmt.Sprintf("%s (%s)", d.Status, d.State)
}
for startTime.Before(until) {
// startTime ~ endTime must be in 90 days
endTime := startTime.AddDate(0, 0, 60)
@ -937,14 +945,6 @@ func (e *Exchange) QueryDepositHistory(
return nil, err
}
toRawStatusStr := func(d maxapi.Deposit) string {
if len(d.StateReason) > 0 {
return fmt.Sprintf("%s (%s: %s)", d.Status, d.State, d.StateReason)
}
return fmt.Sprintf("%s (%s)", d.Status, d.State)
}
for i := len(deposits) - 1; i >= 0; i-- {
d := deposits[i]
if _, ok := txIDs[d.TxID]; ok {