Skip to content

Commit

Permalink
fix: added missing fields in GetAllCoinsInfoService Network structure (
Browse files Browse the repository at this point in the history
…#604)

* fix: added missing fields in GetAllCoinsInfoService Network section

* fix: returned accidentally removed line
  • Loading branch information
paul1319 authored Aug 10, 2024
1 parent 6189b9c commit d2b44ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions v2/asset_detail_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions v2/asset_detail_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}$",
Expand All @@ -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",
Expand All @@ -118,6 +126,10 @@ func (s *assetDetailServiceTestSuite) TestGetAllCoinsInfo() {
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")
}

Expand Down

0 comments on commit d2b44ab

Please sign in to comment.