Common.go testing (#190)

* Common.go testing:
Improved GetHMAC test
Cut ByteArrayToString from common, already have a function that does the same thing
more coverage for SendHTTPRequest test
Improved SendHTTPGetRequest test
added JSONDecode test
added UnixMillis test
added RecvWindow test
added FloatFromString test
added IntFromString test
added Int64FromString test
added TestTimeFromUnixTimestampFloat test
This commit is contained in:
cranktakular
2018-10-09 14:49:21 +11:00
committed by Adrian Gallagher
parent f6bce891c4
commit 7c21cb6f84
3 changed files with 218 additions and 20 deletions

View File

@@ -394,7 +394,7 @@ func (g *Gateio) SendAuthenticatedHTTPRequest(method, endpoint, param string, re
headers["key"] = g.APIKey
hmac := common.GetHMAC(common.HashSHA512, []byte(param), []byte(g.APISecret))
headers["sign"] = common.ByteArrayToString(hmac)
headers["sign"] = common.HexEncodeToString(hmac)
url := fmt.Sprintf("%s/%s/%s", g.APIUrl, gateioAPIVersion, endpoint)