Esempio n. 1
0
def test_get_infura_url(monkeypatch):
    # envvar is "http"
    monkeypatch.setenv(ENV_INFURA_CONNECTION_TYPE, "http")
    assert util.get_infura_url("id1",
                               "net1") == "https://net1.infura.io/v3/id1"

    # envvar is "websocket"
    monkeypatch.setenv(ENV_INFURA_CONNECTION_TYPE, "websocket")
    assert util.get_infura_url("id2",
                               "net2") == "wss://net2.infura.io/ws/v3/id2"

    # envvar is other val - it will resort to "http"
    monkeypatch.setenv(ENV_INFURA_CONNECTION_TYPE, "foo_type")
    assert util.get_infura_url("id3",
                               "net3") == "https://net3.infura.io/v3/id3"
Esempio n. 2
0
 def get_network_config(network_name):
     config = ExampleConfig.get_base_config()
     config['eth-network']['network'] = get_infura_url(
         get_infura_id(), network_name)
     config['eth-network']['artifacts.path'] = 'artifacts'
     return config
Esempio n. 3
0
 def get_network_config(network_name):
     config = ExampleConfig.get_base_config()
     config["eth-network"]["network"] = get_infura_url(
         get_infura_id(), network_name)
     config["eth-network"]["artifacts.path"] = "artifacts"
     return config