From 3d8914afd8acf511e1aa27eced0b3b474a2bccd6 Mon Sep 17 00:00:00 2001 From: paul1319 Date: Fri, 9 Aug 2024 17:28:57 +0300 Subject: [PATCH 1/2] fix: added missing fields in GetAllCoinsInfoService Network section --- v2/asset_detail_service.go | 4 ++++ v2/asset_detail_service_test.go | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/v2/asset_detail_service.go b/v2/asset_detail_service.go index 8139789b..452a0dcb 100644 --- a/v2/asset_detail_service.go +++ b/v2/asset_detail_service.go @@ -111,6 +111,10 @@ type Network struct { WithdrawMax string `json:"withdrawMax"` WithdrawMin string `json:"withdrawMin"` SameAddress bool `json:"sameAddress"` // 是否需要memo + EstimatedArrivalTime int `json:"estimatedArrivalTime"` + Busy bool `json:"busy"` + ContractAddressUrl string `json:"contractAddressUrl"` + ContractAddress string `json:"contractAddress"` } // GetUserAssetService Get user assets diff --git a/v2/asset_detail_service_test.go b/v2/asset_detail_service_test.go index 0ea4b408..3c2f6cdc 100644 --- a/v2/asset_detail_service_test.go +++ b/v2/asset_detail_service_test.go @@ -77,7 +77,11 @@ func (s *assetDetailServiceTestSuite) TestGetAllCoinsInfo() { "withdrawIntegerMultiple": "0.00000001", "withdrawMax": "9999999999.99999999", "withdrawMin": "0.00000440", - "sameAddress": true + "sameAddress": true, + "estimatedArrivalTime": 25, + "busy": false, + "contractAddressUrl": "https://bscscan.com/token/", + "contractAddress": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c" }, { "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$", @@ -96,7 +100,11 @@ func (s *assetDetailServiceTestSuite) TestGetAllCoinsInfo() { "withdrawIntegerMultiple": "0.00000001", "withdrawMax": "750", "withdrawMin": "0.00100000", - "sameAddress": false + "sameAddress": false, + "estimatedArrivalTime": 25, + "busy": false, + "contractAddressUrl": "", + "contractAddress": "" } ], "storage": "0.00000000", @@ -117,7 +125,10 @@ func (s *assetDetailServiceTestSuite) TestGetAllCoinsInfo() { res, err := s.client.NewGetAllCoinsInfoService().Do(newContext()) s.r().NoError(err) s.r().Equal(res[0].DepositAllEnable, true, "depositAllEnable") - s.r().Equal(res[0].NetworkList[0].WithdrawEnable, false, "withdrawEnable") + s.r().Equal(res[0].NetworkList[0].EstimatedArrivalTime, 25, "estimatedArrivalTime") + s.r().Equal(res[0].NetworkList[0].Busy, false, "busy") + s.r().Equal(res[0].NetworkList[0].ContractAddressUrl, "https://bscscan.com/token/", "contractAddressUrl") + s.r().Equal(res[0].NetworkList[0].ContractAddress, "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c", "contractAddress") s.r().Equal(res[0].NetworkList[1].MinConfirm, 1, "minConfirm") } From 587371b02041fc449b21cdbfdfb664db60f2859c Mon Sep 17 00:00:00 2001 From: paul1319 Date: Fri, 9 Aug 2024 17:42:41 +0300 Subject: [PATCH 2/2] fix: returned accidentally removed line --- v2/asset_detail_service_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/asset_detail_service_test.go b/v2/asset_detail_service_test.go index 3c2f6cdc..93bccfcc 100644 --- a/v2/asset_detail_service_test.go +++ b/v2/asset_detail_service_test.go @@ -125,6 +125,7 @@ func (s *assetDetailServiceTestSuite) TestGetAllCoinsInfo() { res, err := s.client.NewGetAllCoinsInfoService().Do(newContext()) s.r().NoError(err) s.r().Equal(res[0].DepositAllEnable, true, "depositAllEnable") + s.r().Equal(res[0].NetworkList[0].WithdrawEnable, false, "withdrawEnable") s.r().Equal(res[0].NetworkList[0].EstimatedArrivalTime, 25, "estimatedArrivalTime") s.r().Equal(res[0].NetworkList[0].Busy, false, "busy") s.r().Equal(res[0].NetworkList[0].ContractAddressUrl, "https://bscscan.com/token/", "contractAddressUrl")