Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Nordelo <[email protected]>
  • Loading branch information
andrew-fleming and ericnordelo authored Nov 25, 2022
1 parent 78f8288 commit d1277cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/nile/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# subject to change
"0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf"
)
OTHER_NETWORKS = {
DEFAULT_GATEWAYS = {
"goerli2": "https://alpha4-2.starknet.io",
"integration": "https://external.integration.starknet.io",
}
Expand All @@ -43,10 +43,10 @@ def get_gateways():

except FileNotFoundError:
with open(NODE_FILENAME, "w") as f:
networks = {"localhost": "http://127.0.0.1:5050/", **OTHER_NETWORKS}
f.write(json.dumps(networks, indent=2))
gateways = {"localhost": "http://127.0.0.1:5050/", **DEFAULT_GATEWAYS}
f.write(json.dumps(gateways, indent=2))

return networks
return gateways


GATEWAYS = get_gateways()
Expand Down
4 changes: 2 additions & 2 deletions src/nile/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import subprocess

from nile.common import NODE_FILENAME, OTHER_NETWORKS
from nile.common import NODE_FILENAME, DEFAULT_GATEWAYS


def node(host="127.0.0.1", port=5050, seed=None, lite_mode=False):
Expand All @@ -16,7 +16,7 @@ def node(host="127.0.0.1", port=5050, seed=None, lite_mode=False):
else:
network = host
gateway_url = f"http://{host}:{port}/"
gateways = {network: gateway_url, **OTHER_NETWORKS}
gateways = {network: gateway_url, **DEFAULT_GATEWAYS}

with open(file, "w+") as f:
json.dump(gateways, f, indent=2)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest

from nile.common import (
OTHER_NETWORKS,
DEFAULT_GATEWAYS,
get_gateways,
parse_information,
prepare_params,
Expand Down Expand Up @@ -58,6 +58,6 @@ def test_parse_information():

def test_get_gateways():
gateways = get_gateways()
expected = {"localhost": "http://127.0.0.1:5050/", **OTHER_NETWORKS}
expected = {"localhost": "http://127.0.0.1:5050/", **DEFAULT_GATEWAYS}

assert gateways == expected

0 comments on commit d1277cf

Please sign in to comment.