2022-07-27 13:27:07 +00:00
|
|
|
import pytest
|
|
|
|
|
2022-12-23 12:58:26 +00:00
|
|
|
from .network import setup_ethermint, setup_geth
|
2022-07-27 13:27:07 +00:00
|
|
|
|
2022-08-02 06:21:03 +00:00
|
|
|
|
2022-07-27 13:27:07 +00:00
|
|
|
@pytest.fixture(scope="session")
|
|
|
|
def ethermint(tmp_path_factory):
|
|
|
|
path = tmp_path_factory.mktemp("ethermint")
|
|
|
|
yield from setup_ethermint(path, 26650)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
|
|
def geth(tmp_path_factory):
|
|
|
|
path = tmp_path_factory.mktemp("geth")
|
|
|
|
yield from setup_geth(path, 8545)
|
|
|
|
|
|
|
|
|
2023-03-13 10:12:04 +00:00
|
|
|
@pytest.fixture(scope="session", params=["ethermint", "ethermint-ws"])
|
2022-10-28 08:10:11 +00:00
|
|
|
def ethermint_rpc_ws(request, ethermint):
|
|
|
|
"""
|
|
|
|
run on both ethermint and ethermint websocket
|
|
|
|
"""
|
|
|
|
provider = request.param
|
|
|
|
if provider == "ethermint":
|
|
|
|
yield ethermint
|
|
|
|
elif provider == "ethermint-ws":
|
|
|
|
ethermint_ws = ethermint.copy()
|
|
|
|
ethermint_ws.use_websocket()
|
|
|
|
yield ethermint_ws
|
|
|
|
else:
|
|
|
|
raise NotImplementedError
|