Skip to content

Commit

Permalink
(fix) Fixed failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abel committed May 7, 2024
1 parent 89b0f01 commit f59766b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sudo dnf install python3-devel autoconf automake gcc gcc-c++ libffi-devel libtoo
**macOS**

```bash
brew install autoconf automake libtool
brew install autoconf automake libtool bufbuild/buf/buf
```

### Quick Start
Expand Down Expand Up @@ -67,7 +67,7 @@ Upgrade `pip` to the latest version, if you see these warnings:

3. Fetch latest denom config
```
poetry run python pyinjective/fetch_metadata.py
poetry run python pyinjective/utils/fetch_metadata.py
```

Note that the [sync client](https://github.com/InjectiveLabs/sdk-python/blob/master/pyinjective/client.py) has been deprecated as of April 18, 2022. If you are using the sync client please make sure to transition to the [async client](https://github.com/InjectiveLabs/sdk-python/blob/master/pyinjective/async_client.py), for more information read [here](https://github.com/InjectiveLabs/sdk-python/issues/101)
Expand Down
2 changes: 2 additions & 0 deletions tests/core/test_network_deprecation_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_use_secure_connection_parameter_deprecation_warning(self):
chain_id="chain_id",
fee_denom="fee_denom",
env="env",
official_tokens_list_url="https://tokens.url",
chain_cookie_assistant=DisabledCookieAssistant(),
exchange_cookie_assistant=DisabledCookieAssistant(),
explorer_cookie_assistant=DisabledCookieAssistant(),
Expand All @@ -40,6 +41,7 @@ def test_use_secure_connection_parameter_in_custom_network_deprecation_warning(s
chain_stream_endpoint="chain_stream_endpoint",
chain_id="chain_id",
env="env",
official_tokens_list_url="https://tokens.url",
chain_cookie_assistant=DisabledCookieAssistant(),
exchange_cookie_assistant=DisabledCookieAssistant(),
explorer_cookie_assistant=DisabledCookieAssistant(),
Expand Down
12 changes: 10 additions & 2 deletions tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ async def test_initialize_tokens_and_markets(
ape_usdt_spot_market_meta,
btc_usdt_perp_market_meta,
first_match_bet_market_meta,
aioresponses,
):
test_network = Network.local()
aioresponses.get(test_network.official_tokens_list_url, payload=[])

spot_servicer.markets_responses.append(
injective_spot_exchange_rpc_pb2.MarketsResponse(
markets=[inj_usdt_spot_market_meta, ape_usdt_spot_market_meta]
Expand All @@ -101,7 +105,7 @@ async def test_initialize_tokens_and_markets(
)

client = AsyncClient(
network=Network.local(),
network=test_network,
insecure=False,
)

Expand Down Expand Up @@ -144,7 +148,11 @@ async def test_initialize_tokens_from_chain_denoms(
spot_servicer,
derivative_servicer,
smart_denom_metadata,
aioresponses,
):
test_network = Network.local()
aioresponses.get(test_network.official_tokens_list_url, payload=[])

pagination = pagination_pb.PageResponse(
total=1,
)
Expand All @@ -163,7 +171,7 @@ async def test_initialize_tokens_from_chain_denoms(
)

client = AsyncClient(
network=Network.local(),
network=test_network,
insecure=False,
)

Expand Down

0 comments on commit f59766b

Please sign in to comment.