Skip to content

Commit cf1109b

Browse files
authored
Merge pull request #207 from alimcmaster1/master
Fix withdraw to coinbase account bug/ unit test fixes
2 parents 01370b7 + ff07566 commit cf1109b

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

gdax/authenticated_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def coinbase_withdraw(self, amount="", currency="", coinbase_account_id=""):
253253
"currency": currency,
254254
"coinbase_account_id": coinbase_account_id
255255
}
256-
r = requests.post(self.url + "/withdrawals/coinbase", data=json.dumps(payload), auth=self.auth, timeout=self.timeout)
256+
r = requests.post(self.url + "/withdrawals/coinbase-account", data=json.dumps(payload), auth=self.auth, timeout=self.timeout)
257257
# r.raise_for_status()
258258
return r.json()
259259

gdax/gdax_auth.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ def __init__(self, api_key, secret_key, passphrase):
1414

1515
def __call__(self, request):
1616
timestamp = str(time.time())
17-
message = timestamp + request.method + request.path_url + (request.body or '')
18-
request.headers.update(get_auth_headers(timestamp, message, self.api_key, self.secret_key,
17+
message = ''.join([timestamp, request.method,
18+
request.path_url, (request.body or '')])
19+
request.headers.update(get_auth_headers(timestamp, message,
20+
self.api_key,
21+
self.secret_key,
1922
self.passphrase))
2023
return request
2124

tests/test_public_client.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import pytest
22
import gdax
33
import time
4+
import datetime
5+
from dateutil.relativedelta import relativedelta
46

57

68
@pytest.fixture(scope='module')
@@ -46,9 +48,11 @@ def test_get_product_trades(self, client):
4648
assert type(r) is list
4749
assert 'trade_id' in r[0]
4850

49-
@pytest.mark.parametrize('start', ('2017-11-01', None))
50-
@pytest.mark.parametrize('end', ('2017-11-30', None))
51-
@pytest.mark.parametrize('granularity', (3600, None))
51+
current_time = datetime.datetime.now()
52+
53+
@pytest.mark.parametrize('start,end,granularity',
54+
[(current_time - relativedelta(months=1),
55+
current_time, 10000)])
5256
def test_get_historic_rates(self, client, start, end, granularity):
5357
r = client.get_product_historic_rates('BTC-USD', start=start, end=end, granularity=granularity)
5458
assert type(r) is list

0 commit comments

Comments
 (0)