|
4 | 4 | import inspect |
5 | 5 | from threading import Timer as ThreadingTimer |
6 | 6 | from time import sleep |
| 7 | +from typing import cast |
7 | 8 |
|
8 | 9 | import xrpl # noqa: F401 - needed for sync tests |
9 | 10 | from xrpl.asyncio.clients import AsyncJsonRpcClient, AsyncWebsocketClient |
|
28 | 29 | WEBSOCKET_URL = "ws://127.0.0.1:6006" |
29 | 30 |
|
30 | 31 | JSON_TESTNET_URL = "https://s.altnet.rippletest.net:51234" |
31 | | -WEBSOCKET_TESTNET_URL = "wss://s.altnet.rippletest.net" |
| 32 | +WEBSOCKET_TESTNET_URL = "wss://s.altnet.rippletest.net:51233" |
32 | 33 |
|
33 | 34 | JSON_RPC_CLIENT = JsonRpcClient(JSON_RPC_URL) |
34 | 35 | ASYNC_JSON_RPC_CLIENT = AsyncJsonRpcClient(JSON_RPC_URL) |
@@ -90,7 +91,8 @@ def __init__( |
90 | 91 | delay: float = LEDGER_ACCEPT_TIME, |
91 | 92 | request: Request = LEDGER_ACCEPT_REQUEST, |
92 | 93 | ): |
93 | | - self._timer = ThreadingTimer(delay, client.request, (request,)).start() |
| 94 | + self._timer = ThreadingTimer(delay, client.request, (request,)) |
| 95 | + self._timer.start() |
94 | 96 |
|
95 | 97 | def cancel(self): |
96 | 98 | self._timer.cancel() |
@@ -122,7 +124,7 @@ async def fund_wallet( |
122 | 124 | def submit_transaction( |
123 | 125 | transaction: Transaction, |
124 | 126 | wallet: Wallet, |
125 | | - client: Client = JSON_RPC_CLIENT, |
| 127 | + client: SyncClient = JSON_RPC_CLIENT, |
126 | 128 | check_fee: bool = True, |
127 | 129 | ) -> Response: |
128 | 130 | """Signs and submits a transaction to the XRPL.""" |
@@ -188,12 +190,12 @@ async def accept_ledger_async( |
188 | 190 | AsyncTestTimer(client, delay) |
189 | 191 |
|
190 | 192 |
|
191 | | -def _choose_client(use_json_client: bool) -> Client: |
192 | | - return _CLIENTS[(False, use_json_client, False)] |
| 193 | +def _choose_client(use_json_client: bool) -> SyncClient: |
| 194 | + return cast(SyncClient, _CLIENTS[(False, use_json_client, False)]) |
193 | 195 |
|
194 | 196 |
|
195 | | -def _choose_client_async(use_json_client: bool) -> Client: |
196 | | - return _CLIENTS[(True, use_json_client, False)] |
| 197 | +def _choose_client_async(use_json_client: bool) -> AsyncClient: |
| 198 | + return cast(AsyncClient, _CLIENTS[(True, use_json_client, False)]) |
197 | 199 |
|
198 | 200 |
|
199 | 201 | def _get_client(is_async: bool, is_json: bool, is_testnet: bool) -> Client: |
|
0 commit comments