mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1729 from c9s/c9s/max/fix-v3-deposit-state-conversion
FIX: [max] fix v3 deposit state conversion
This commit is contained in:
commit
699164484b
|
@ -284,11 +284,18 @@ func toGlobalDepositStatus(a max.DepositState) types.DepositStatus {
|
|||
|
||||
case max.DepositStateAccepted:
|
||||
return types.DepositSuccess
|
||||
|
||||
case max.DepositStateProcessing: // v3 states
|
||||
return types.DepositPending
|
||||
|
||||
case max.DepositStateDone: // v3 states
|
||||
return types.DepositSuccess
|
||||
|
||||
}
|
||||
|
||||
// other states goes to this
|
||||
// max.DepositStateSuspect, max.DepositStateSuspended
|
||||
log.Warnf("unsupported deposit state %q from max exchange", a)
|
||||
log.Errorf("unsupported deposit state %q from max exchange", a)
|
||||
return types.DepositStatus(a)
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,10 @@ const (
|
|||
DepositStateSuspended DepositState = "suspended"
|
||||
DepositStateAccepted DepositState = "accepted"
|
||||
DepositStateChecking DepositState = "checking"
|
||||
|
||||
// v3 states
|
||||
DepositStateProcessing DepositState = "processing"
|
||||
DepositStateDone DepositState = "done"
|
||||
)
|
||||
|
||||
type Deposit struct {
|
||||
|
|
|
@ -236,7 +236,7 @@ func (s *Strategy) scanDepositHistory(ctx context.Context, asset string, duratio
|
|||
s.watchingDeposits[deposit.TransactionID] = deposit
|
||||
}
|
||||
} else {
|
||||
// ignore all initial deposit history that are already success
|
||||
// ignore all initial deposits that are already in success status
|
||||
logger.Infof("ignored succeess deposit: %s %+v", deposit.TransactionID, deposit)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user