def test_validate_voluntary_exit(genesis_state, keymap, slots_per_epoch,
                                 persistent_committee_period, config):
    state = genesis_state.copy(slot=compute_start_slot_at_epoch(
        config.GENESIS_EPOCH + persistent_committee_period, slots_per_epoch))
    validator_index = 0
    valid_voluntary_exit = create_mock_voluntary_exit(state, config, keymap,
                                                      validator_index)
    validate_voluntary_exit(state, valid_voluntary_exit, slots_per_epoch,
                            persistent_committee_period)
Ejemplo n.º 2
0
def test_validate_voluntary_exit(genesis_state, keymap, slots_per_epoch,
                                 shard_committee_period, config):
    state = genesis_state.set(
        "slot",
        compute_start_slot_at_epoch(GENESIS_EPOCH + shard_committee_period,
                                    slots_per_epoch),
    )
    validator_index = 0
    valid_voluntary_exit = create_mock_voluntary_exit(state, config, keymap,
                                                      validator_index)
    validate_voluntary_exit(state, valid_voluntary_exit, slots_per_epoch,
                            shard_committee_period)
def test_validate_voluntary_exit(genesis_state, keymap, slots_per_epoch,
                                 activation_exit_delay, config):
    state = genesis_state
    validator_index = 0
    valid_voluntary_exit = create_mock_voluntary_exit(
        state,
        config,
        keymap,
        validator_index,
    )
    validate_voluntary_exit(state, valid_voluntary_exit, slots_per_epoch,
                            activation_exit_delay)
def test_validate_voluntary_exit(genesis_state, keymap, slots_per_epoch,
                                 persistent_committee_period, config):
    state = genesis_state.copy(slot=get_epoch_start_slot(
        config.GENESIS_EPOCH + persistent_committee_period, slots_per_epoch), )
    validator_index = 0
    validator = state.validator_registry[validator_index].copy(
        activation_epoch=config.GENESIS_EPOCH, )
    state = state.update_validator_registry(validator_index, validator)
    valid_voluntary_exit = create_mock_voluntary_exit(
        state,
        config,
        keymap,
        validator_index,
    )
    validate_voluntary_exit(
        state,
        valid_voluntary_exit,
        slots_per_epoch,
        persistent_committee_period,
    )