Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions tests/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
import warnings


def validate_rpc(rpc: dict[str, Any], method: str, validator: Callable[[dict[str, Any]], None]) -> None:
def validate_rpc(
rpc: dict[str, Any],
method: str,
validator: Callable[[dict[str, Any]], bool],
params: list[Any] | None = None,
) -> None:
"""Validate RPC endpoint with specified method and validation function"""
try:
resp = urllib3.request(
method='POST',
url=(url := rpc['endpoint']),
json={'method': method, 'params': [], 'id': 1, 'jsonrpc': '2.0'},
json={'method': method, 'params': params or [], 'id': 1, 'jsonrpc': '2.0'},
retries=1,
timeout=5,
)
Expand Down Expand Up @@ -46,6 +51,8 @@ def test_nodes() -> None:
56: 'BINANCE_SC',
100: 'GNOSIS',
137: 'POLYGON_POS',
143: 'MONAD',
999: 'HYPERLIQUID',
8453: 'BASE',
42161: 'ARBITRUM_ONE',
534352: 'SCROLL',
Expand All @@ -72,5 +79,14 @@ def test_nodes() -> None:
method='eth_chainId',
validator=lambda resp: evm_chains_mapping[int(resp['result'], 0)] == rpc['blockchain'],
)
validate_rpc(
rpc=rpc,
method='eth_call',
params=[{
'data': '0x1234',
'to': '0x0000000000000000000000000000000000000004',
}, 'latest'],
validator=lambda resp: resp['result'] == '0x1234',
)

assert all(weight == 1 for weight in per_chain_weight.values()), f'Weights do not add for v{i}: {per_chain_weight=}'
5 changes: 3 additions & 2 deletions updates/info.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"spam_assets": { "latest": 7 },
"rpc_nodes": {
"latest": 11,
"latest": 12,
"limits": {
"9": { "min_version": "1.39.0" },
"10": { "min_version": "1.41.0" },
"11": { "min_version": "1.43.0" }
"11": { "min_version": "1.43.0" },
"12": { "min_version": "1.43.0" }
}
},
"contracts": { "latest": 0 },
Expand Down
Loading