mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2025-01-08 10:25:24 +03:00
Confirm equality of client and server RPC routes (#11765)
* Confirm equality of client and server RPC routes * Update rpc.py * hints * Update rpc.py * Update mypy.ini * Update rpc_server.py * Update tests/util/rpc.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
This commit is contained in:
parent
23ff56579a
commit
8436e6a17a
@ -2,17 +2,18 @@ from chia.rpc.rpc_client import RpcClient
|
||||
from chia.rpc.rpc_server import RpcApiProtocol
|
||||
|
||||
|
||||
async def validate_get_routes(client: RpcClient, api: RpcApiProtocol):
|
||||
async def validate_get_routes(client: RpcClient, api: RpcApiProtocol) -> None:
|
||||
routes_client = (await client.fetch("get_routes", {}))["routes"]
|
||||
assert len(routes_client) > 0
|
||||
routes_api = list(api.get_routes().keys())
|
||||
# TODO: avoid duplication of RpcServer.get_routes()
|
||||
routes_server = [
|
||||
"/get_connections",
|
||||
"/open_connection",
|
||||
"/close_connection",
|
||||
"/stop_node",
|
||||
"/get_routes",
|
||||
"/healthz",
|
||||
]
|
||||
assert len(routes_api) > 0
|
||||
for route in routes_api + routes_server:
|
||||
assert route in routes_client
|
||||
assert sorted(routes_client) == sorted(routes_api + routes_server)
|
||||
|
Loading…
Reference in New Issue
Block a user