From 774259245842dd69ed7731d8ef09a772d9c837b0 Mon Sep 17 00:00:00 2001 From: Gennadii Muzykantov <46723083+muzykantov@users.noreply.github.com> Date: Sat, 18 Jun 2022 00:12:13 +0800 Subject: [PATCH] Fix Unmarshal error on ListDeposits API response (#381) --- v2/deposit_service.go | 2 +- v2/deposit_service_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/v2/deposit_service.go b/v2/deposit_service.go index e06a306f..400053dc 100644 --- a/v2/deposit_service.go +++ b/v2/deposit_service.go @@ -105,7 +105,7 @@ type Deposit struct { TxID string `json:"txId"` InsertTime int64 `json:"insertTime"` TransferType int64 `json:"transferType"` - UnlockConfirm string `json:"unlockConfirm"` + UnlockConfirm int64 `json:"unlockConfirm"` ConfirmTimes string `json:"confirmTimes"` } diff --git a/v2/deposit_service_test.go b/v2/deposit_service_test.go index 1510e937..e6105566 100644 --- a/v2/deposit_service_test.go +++ b/v2/deposit_service_test.go @@ -26,7 +26,7 @@ func (s *depositServiceTestSuite) TestListDeposits() { "txId":"0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3", "insertTime":1599621997000, "transferType":0, - "unlockConfirm":"12/12", + "unlockConfirm":12, "confirmTimes":"12/12" }, { @@ -39,7 +39,7 @@ func (s *depositServiceTestSuite) TestListDeposits() { "txId":"ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999", "insertTime":1599620082000, "transferType":0, - "unlockConfirm":"1/12", + "unlockConfirm":1, "confirmTimes":"1/1" } ]`) @@ -79,7 +79,7 @@ func (s *depositServiceTestSuite) TestListDeposits() { TxID: "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3", InsertTime: 1599621997000, TransferType: 0, - UnlockConfirm: "12/12", + UnlockConfirm: 12, ConfirmTimes: "12/12", }, deposits[0]) s.assertDepositEqual(&Deposit{ @@ -92,7 +92,7 @@ func (s *depositServiceTestSuite) TestListDeposits() { TxID: "ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999", InsertTime: 1599620082000, TransferType: 0, - UnlockConfirm: "1/12", + UnlockConfirm: 1, ConfirmTimes: "1/1", }, deposits[1]) }