9
9
from pyinjective .proto .injective .exchange .v2 import query_pb2 as exchange_query_pb
10
10
from tests .client .chain .grpc .configurable_bank_query_servicer import ConfigurableBankQueryServicer
11
11
from tests .client .chain .grpc .configurable_exchange_v2_query_servicer import ConfigurableExchangeV2QueryServicer
12
+ from tests .core .tendermint .grpc .configurable_tendermint_query_servicer import ConfigurableTendermintQueryServicer
12
13
from tests .rpc_fixtures .markets_fixtures import ( # noqa: F401
13
14
ape_token_meta ,
14
15
ape_usdt_spot_market_meta ,
@@ -33,13 +34,20 @@ def exchange_servicer():
33
34
return ConfigurableExchangeV2QueryServicer ()
34
35
35
36
37
+ @pytest .fixture
38
+ def tendermint_servicer ():
39
+ return ConfigurableTendermintQueryServicer ()
40
+
41
+
36
42
class TestAsyncClient :
37
43
@pytest .mark .asyncio
38
- async def test_sync_timeout_height_logs_exception (self , caplog ):
44
+ async def test_sync_timeout_height_logs_exception (self , caplog , tendermint_servicer ):
39
45
client = AsyncClient (
40
46
network = Network .local (),
41
47
)
42
48
49
+ client .tendermint_api ._stub = tendermint_servicer
50
+
43
51
with caplog .at_level (logging .DEBUG ):
44
52
await client .sync_timeout_height ()
45
53
@@ -53,11 +61,13 @@ async def test_sync_timeout_height_logs_exception(self, caplog):
53
61
assert found_log [1 ] == logging .DEBUG
54
62
55
63
@pytest .mark .asyncio
56
- async def test_get_account_logs_exception (self , caplog ):
64
+ async def test_get_account_logs_exception (self , caplog , tendermint_servicer ):
57
65
client = AsyncClient (
58
66
network = Network .local (),
59
67
)
60
68
69
+ client .tendermint_api ._stub = tendermint_servicer
70
+
61
71
with caplog .at_level (logging .DEBUG ):
62
72
await client .fetch_account (address = "" )
63
73
@@ -74,6 +84,7 @@ async def test_get_account_logs_exception(self, caplog):
74
84
async def test_initialize_tokens_and_markets (
75
85
self ,
76
86
exchange_servicer ,
87
+ tendermint_servicer ,
77
88
inj_usdt_spot_market_meta ,
78
89
ape_usdt_spot_market_meta ,
79
90
btc_usdt_perp_market_meta ,
@@ -163,6 +174,7 @@ async def test_initialize_tokens_and_markets(
163
174
)
164
175
165
176
client .chain_exchange_v2_api ._stub = exchange_servicer
177
+ client .tendermint_api ._stub = tendermint_servicer
166
178
167
179
await client ._initialize_tokens_and_markets ()
168
180
@@ -199,6 +211,7 @@ async def test_initialize_tokens_and_markets(
199
211
async def test_tokens_and_markets_initialization_read_tokens_from_official_list (
200
212
self ,
201
213
exchange_servicer ,
214
+ tendermint_servicer ,
202
215
inj_usdt_spot_market_meta ,
203
216
ape_usdt_spot_market_meta ,
204
217
btc_usdt_perp_market_meta ,
@@ -255,6 +268,7 @@ async def test_tokens_and_markets_initialization_read_tokens_from_official_list(
255
268
)
256
269
257
270
client .chain_exchange_v2_api ._stub = exchange_servicer
271
+ client .tendermint_api ._stub = tendermint_servicer
258
272
259
273
await client ._initialize_tokens_and_markets ()
260
274
@@ -267,6 +281,7 @@ async def test_initialize_tokens_from_chain_denoms(
267
281
self ,
268
282
bank_servicer ,
269
283
exchange_servicer ,
284
+ tendermint_servicer ,
270
285
smart_denom_metadata ,
271
286
aioresponses ,
272
287
):
@@ -296,8 +311,9 @@ async def test_initialize_tokens_from_chain_denoms(
296
311
network = test_network ,
297
312
)
298
313
299
- client .chain_exchange_v2_api ._stub = exchange_servicer
300
314
client .bank_api ._stub = bank_servicer
315
+ client .chain_exchange_v2_api ._stub = exchange_servicer
316
+ client .tendermint_api ._stub = tendermint_servicer
301
317
302
318
await client ._initialize_tokens_and_markets ()
303
319
await client .initialize_tokens_from_chain_denoms ()
0 commit comments