Exemplo n.º 1
0
no_genesis = dataclasses.replace(test_constants_modified, GENESIS_CHALLENGE=None)
b_tools = BlockTools(constants=no_genesis)
b_tools_1 = BlockTools(constants=no_genesis)

master_int = 5399117110774477986698372024995405256382522670366369834617409486544348441851
master_sk: PrivateKey = PrivateKey.from_bytes(master_int.to_bytes(32, "big"))
pubkey_alert = bytes(master_sk.get_g1()).hex()
alert_url = "http://127.0.0.1:59000/status"

new_config = b_tools._config
new_config["CHIA_ALERTS_PUBKEY"] = pubkey_alert
new_config["ALERTS_URL"] = alert_url
new_config["daemon_port"] = 55401
new_config["network_overrides"]["constants"][new_config["selected_network"]]["GENESIS_CHALLENGE"] = None
b_tools.change_config(new_config)

new_config_1 = b_tools_1._config
new_config_1["CHIA_ALERTS_PUBKEY"] = pubkey_alert
new_config_1["ALERTS_URL"] = alert_url
new_config_1["daemon_port"] = 55402
new_config_1["network_overrides"]["constants"][new_config_1["selected_network"]]["GENESIS_CHALLENGE"] = None
b_tools_1.change_config(new_config_1)


class TestDaemonAlerts:
    @pytest.fixture(scope="function")
    async def get_daemon(self):
        async for _ in setup_daemon(btools=b_tools):
            yield _
Exemplo n.º 2
0
from src.server.outbound_message import NodeType
from src.server.server import ssl_context_for_server
from src.types.peer_info import PeerInfo
from src.util.block_tools import BlockTools
from src.util.ints import uint16
from src.util.ws_message import create_payload
from tests.core.node_height import node_height_at_least
from tests.setup_nodes import setup_daemon, self_hostname, setup_full_system
from tests.simulation.test_simulation import test_constants_modified
from tests.time_out_assert import time_out_assert, time_out_assert_custom_interval

b_tools = BlockTools(constants=test_constants_modified)
b_tools_1 = BlockTools(constants=test_constants_modified)
new_config = b_tools._config
new_config["daemon_port"] = 55401
b_tools.change_config(new_config)


class TestDaemon:
    @pytest.fixture(scope="function")
    async def get_daemon(self):
        async for _ in setup_daemon(btools=b_tools):
            yield _

    @pytest.fixture(scope="function")
    async def simulation(self):
        async for _ in setup_full_system(b_tools_1.constants,
                                         b_tools=b_tools,
                                         b_tools_1=b_tools_1,
                                         connect_to_daemon=True):
            yield _