max: fix withdraw state convert by calling convertWithdrawStatusV2

v3 api does not return status field
This commit is contained in:
c9s 2024-08-07 17:12:55 +08:00
parent ffb2c14f1d
commit 25b0b5ded5
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
3 changed files with 3 additions and 4 deletions

View File

@ -361,7 +361,7 @@ func convertWithdrawStatusV3(status max.WithdrawStatus) types.WithdrawStatus {
return types.WithdrawStatus(status)
}
func convertWithdrawStatus(state max.WithdrawState) types.WithdrawStatus {
func convertWithdrawStatusV2(state max.WithdrawState) types.WithdrawStatus {
switch state {
case max.WithdrawStateSent, max.WithdrawStateSubmitting, max.WithdrawStatePending, "accepted", "approved":

View File

@ -865,8 +865,7 @@ func (e *Exchange) QueryWithdrawHistory(
continue
}
// we can convert this later
status := convertWithdrawStatusV3(d.Status)
status := convertWithdrawStatusV2(d.State)
txIDs[d.TxID] = struct{}{}
withdraw := types.Withdraw{

View File

@ -194,7 +194,7 @@ type Withdraw struct {
// "sygna_verifying"
State WithdrawState `json:"state"`
Status WithdrawStatus `json:"status,omitempty"`
// Status WithdrawStatus `json:"status,omitempty"`
CreatedAt types.MillisecondTimestamp `json:"created_at"`
UpdatedAt types.MillisecondTimestamp `json:"updated_at"`