Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 27, 2023
1 parent ed296db commit bcefb10
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions integration_tests/test_client_id.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
import json
from pathlib import Path

import pytest
from pystarport import ports

from .network import setup_custom_cronos
from .utils import wait_for_port


@pytest.fixture(scope="module")
def custom_cronos(tmp_path_factory):
path = tmp_path_factory.mktemp("cronos")
yield from setup_custom_cronos(
path,
26800,
Path(__file__).parent / "configs/default.jsonnet",
)


def test_config_client_id(custom_cronos):
def test_config_client_id(cronos):
n0 = "cronos_777-1-node0"
p0 = custom_cronos.base_port(0)
w3 = custom_cronos.w3
custom_cronos.supervisorctl("stop", n0)
cli = custom_cronos.cosmos_cli(0)
p0 = cronos.base_port(0)
w3 = cronos.w3
cronos.supervisorctl("stop", n0)
cli = cronos.cosmos_cli(0)
dir = cli.data_dir / "config"

def edit_gensis_cfg(chain_id):
Expand All @@ -35,9 +23,9 @@ def edit_gensis_cfg(chain_id):
# start with empty chain_id from genesis should fail
edit_gensis_cfg("")
with pytest.raises(Exception):
custom_cronos.supervisorctl("start", n0)
cronos.supervisorctl("start", n0)

edit_gensis_cfg("cronos_777-1")
custom_cronos.supervisorctl("start", n0)
cronos.supervisorctl("start", n0)
wait_for_port(ports.evmrpc_port(p0))
assert w3.eth.chain_id == 777

0 comments on commit bcefb10

Please sign in to comment.