Sort list of chain ids returned by `/condition_chains` node endpoint.

Update test.
pull/3576/head
derekpierre 2025-02-03 09:09:07 -05:00
parent 846cd931c7
commit 75e49a603f
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View File

@ -154,8 +154,9 @@ def _make_rest_app(this_node, log: Logger) -> Flask:
"""
# TODO: When non-evm chains are supported, bump the version.
# this can return a list of chain names or other verifiable identifiers.
payload = {"version": 1.0, "evm": list(this_node.condition_providers.providers)}
providers = this_node.condition_providers.providers
sorted_chain_ids = sorted(list(providers))
payload = {"version": 1.0, "evm": sorted_chain_ids}
return Response(json.dumps(payload), mimetype="application/json")
@rest_app.route('/decrypt', methods=["POST"])

View File

@ -18,5 +18,5 @@ def test_condition_chains_endpoint_multichain(
):
response = client.get("/condition_chains")
assert response.status_code == 200
expected_payload = {"version": 1.0, "evm": multichain_ids}
expected_payload = {"version": 1.0, "evm": sorted(multichain_ids)}
assert response.get_json() == expected_payload