Skip to content

Commit 9be6ff9

Browse files
committed
test: update Info API test parameters to match Chainstack examples
1 parent 8594a63 commit 9be6ff9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/info_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from hyperliquid.info import Info
44
from hyperliquid.utils.types import L2BookData, Meta, SpotMeta
5+
from hyperliquid.utils.error import ServerError
56

67
TEST_META: Meta = {"universe": []}
78
TEST_SPOT_META: SpotMeta = {"universe": [], "tokens": []}
@@ -190,7 +191,7 @@ def test_portfolio():
190191
@pytest.mark.vcr()
191192
def test_batch_clearinghouse_states():
192193
info = Info(skip_ws=True, meta=TEST_META, spot_meta=TEST_SPOT_META)
193-
users = ["0x5e9ee1089755c3435139848e47e6635505d5a13a", "0xb7b6f3cea3f66bf525f5d8f965f6dbf6d9b017b2"]
194+
users = ["0x31ca8395cf837de08b24da3f660e77761dfb974b", "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036"]
194195
# Note: This endpoint may not be available on all Hyperliquid nodes
195196
# It's only available on the official Hyperliquid public API
196197
try:
@@ -201,7 +202,7 @@ def test_batch_clearinghouse_states():
201202
# Each state should have the same structure as clearinghouseState
202203
assert "assetPositions" in state, "Each state should have assetPositions"
203204
assert "marginSummary" in state, "Each state should have marginSummary"
204-
except (ConnectionError, TimeoutError, ValueError) as e:
205+
except (ConnectionError, TimeoutError, ValueError, ServerError) as e:
205206
# This is expected if the endpoint is not available
206207
print(f"batch_clearinghouse_states not available: {e}")
207208

@@ -235,7 +236,7 @@ def test_user_vault_equities():
235236
@pytest.mark.vcr()
236237
def test_user_role():
237238
info = Info(skip_ws=True, meta=TEST_META, spot_meta=TEST_SPOT_META)
238-
response = info.user_role(user="0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036")
239+
response = info.user_role(user="0x31ca8395cf837de08b24da3f660e77761dfb974b")
239240
assert isinstance(response, dict), "The response should be a dictionary"
240241
# User role should contain account type and role information
241242
assert (
@@ -256,7 +257,7 @@ def test_user_rate_limit():
256257
@pytest.mark.vcr()
257258
def test_delegator_history():
258259
info = Info(skip_ws=True, meta=TEST_META, spot_meta=TEST_SPOT_META)
259-
response = info.delegator_history(user="0x5e9ee1089755c3435139848e47e6635505d5a13a")
260+
response = info.delegator_history(user="0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036")
260261
assert isinstance(response, list), "The response should be a list"
261262
# Delegator history should contain delegation/undelegation events
262263
for event in response:

0 commit comments

Comments
 (0)