Skip to content

Commit

Permalink
Merge pull request #93 from rhettre/bugfix/error-response
Browse files Browse the repository at this point in the history
Bugfix/error response
  • Loading branch information
rhettre committed Sep 6, 2024
2 parents 0eb7a86 + 3856c40 commit 3c4f8cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions coinbase_advanced_trader/legacy_tests/test_coinbase_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_cancel_orders(self, mock_cb_auth):
self.assertTrue(results['success'])
self.assertEqual(results['failure_reason'],
"UNKNOWN_CANCEL_FAILURE_REASON")
self.assertEqual(results['order_id'], "0000-00000")
self.assertEqual(results['success_response']['order_id'], "0000-00000")

@patch('coinbase_advanced_trader.coinbase_client.cb_auth')
def test_list_orders(self, mock_cb_auth):
Expand Down Expand Up @@ -341,7 +341,7 @@ def test_get_order(self, mock_cb_auth):
self.assertIsNotNone(result)
self.assertIsInstance(result, dict)
self.assertIn('order', result)
self.assertEqual(result['order']['order_id'], order_id)
self.assertEqual(result['order']['success_response']['order_id'], order_id)
self.assertEqual(result['order']['product_id'], 'BTC-USD')
self.assertEqual(result['order']['status'], 'OPEN')

Expand Down
6 changes: 3 additions & 3 deletions coinbase_advanced_trader/services/order_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def fiat_market_buy(self, product_id: str, fiat_amount: str) -> Order:
raise Exception(error_log)

order = Order(
id=order_response['order_id'],
id=order_response['success_response']['order_id'],
product_id=product_id,
side=OrderSide.BUY,
type=OrderType.MARKET,
Expand Down Expand Up @@ -113,7 +113,7 @@ def fiat_market_sell(self, product_id: str, fiat_amount: str) -> Order:
raise Exception(error_log)

order = Order(
id=order_response['order_id'],
id=order_response['success_response']['order_id'],
product_id=product_id,
side=OrderSide.SELL,
type=OrderType.MARKET,
Expand Down Expand Up @@ -198,7 +198,7 @@ def _place_limit_order(self, product_id: str, fiat_amount: str, limit_price: Opt
)

order = Order(
id=order_response['order_id'],
id=order_response['success_response']['order_id'],
product_id=product_id,
side=side,
type=OrderType.LIMIT,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='coinbase-advancedtrade-python',
version='0.2.4',
version='0.2.5',
description='The unofficial Python client for the Coinbase Advanced Trade API',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 3c4f8cc

Please sign in to comment.