Exemplo n.º 1
0
def no_rpc():
    config._unlock()
    config['networks']['development']['host'] = "http://127.0.0.1:31337"
    web3.connect("http://127.0.0.1:31337")
    proc = rpc._rpc
    reset_id = rpc._reset_id
    rpc._rpc = None
    rpc._reset_id = False
    rpc._launch = rpc.launch
    rpc.launch = _launch
    rpc._reset()
    yield
    config['networks']['development']['host'] = "http://127.0.0.1:8545"
    web3.connect("http://127.0.0.1:8545")
    rpc.launch = rpc._launch
    rpc.kill(False)
    rpc._reset()
    rpc._rpc = proc
    rpc._reset_id = reset_id
Exemplo n.º 2
0
def no_rpc():
    config._unlock()
    config["network"]["networks"]["development"][
        "host"] = "http://127.0.0.1:31337"
    web3.connect("http://127.0.0.1:31337")
    proc = rpc._rpc
    reset_id = rpc._reset_id
    rpc._rpc = None
    rpc._reset_id = False
    rpc._launch = rpc.launch
    rpc.launch = _launch
    _notify_registry(0)
    yield
    config["network"]["networks"]["development"][
        "host"] = "http://127.0.0.1:8545"
    web3.connect("http://127.0.0.1:8545")
    rpc.launch = rpc._launch
    rpc.kill(False)
    _notify_registry(0)
    rpc._rpc = proc
    rpc._reset_id = reset_id
Exemplo n.º 3
0
def test_kill(no_rpc):
    rpc.kill()
    with pytest.raises(SystemError):
        rpc.kill()
    rpc.kill(False)