Nonce generation must be the same of the previous version

This commit is contained in:
Dario Moceri
2023-02-20 11:14:34 +01:00
committed by GitHub
parent 5914d7fa8c
commit 3c760eacf6

View File

@@ -19,7 +19,7 @@ class Middleware(object):
assert isinstance(self.API_KEY, str) and isinstance(self.API_SECRET, str), \
"API_KEY and API_SECRET must be both str to call __build_authentication_headers"
nonce = str(int(time.time()) * 1000)
nonce = int(round(time.time() * 1000000))
if data == None:
path = f"/api/v2/{endpoint}{nonce}"
@@ -79,4 +79,4 @@ class Middleware(object):
if data[1] == None or data[1] == Error.ERR_UNK or data[1] == Error.ERR_GENERIC:
raise UnknownGenericError(f"The server replied to the request with a generic error with message: <{data[2]}>.")
return data
return data