2019-03-18 16:18:57 +00:00
|
|
|
import pytest
|
2019-03-18 18:51:52 +00:00
|
|
|
|
2019-04-03 03:18:17 +00:00
|
|
|
from eth2spec.phase0 import spec
|
2019-04-22 07:46:13 +00:00
|
|
|
from preset_loader import loader
|
2019-03-18 16:18:57 +00:00
|
|
|
|
2019-03-27 18:30:47 +00:00
|
|
|
from .helpers import (
|
2019-03-18 22:20:24 +00:00
|
|
|
create_genesis_state,
|
2019-03-18 18:51:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-04-22 07:46:13 +00:00
|
|
|
def pytest_addoption(parser):
|
|
|
|
parser.addoption(
|
|
|
|
"--config", action="store", default="minimal", help="config: make the pyspec use the specified configuration"
|
|
|
|
)
|
2019-03-18 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
2019-04-22 07:46:13 +00:00
|
|
|
def config(request):
|
|
|
|
config_name = request.config.getoption("--config")
|
|
|
|
presets = loader.load_presets('../../configs/', config_name)
|
|
|
|
spec.apply_constants_preset(presets)
|
2019-03-18 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2019-04-24 18:31:27 +00:00
|
|
|
def num_validators(config):
|
|
|
|
return spec.SLOTS_PER_EPOCH * 8
|
2019-03-18 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def deposit_data_leaves():
|
|
|
|
return list()
|
|
|
|
|
2019-03-18 16:18:57 +00:00
|
|
|
|
2019-03-18 18:51:52 +00:00
|
|
|
@pytest.fixture
|
|
|
|
def state(num_validators, deposit_data_leaves):
|
|
|
|
return create_genesis_state(num_validators, deposit_data_leaves)
|