contract TestMixinScheduler is
    TestStaking
{
    uint256 public testDeployedTimestamp;

    event GoToNextEpochTestInfo(
        uint256 oldEpoch,
        uint256 blockTimestamp
    );

    constructor(
        address wethAddress,
        address zrxVaultAddress
    )
        public
        TestStaking(
            wethAddress,
            zrxVaultAddress
        )
    {
        _addAuthorizedAddress(msg.sender);
        init();
        _removeAuthorizedAddressAtIndex(msg.sender, 0);

        // Record time of deployment
        // solhint-disable-next-line not-rely-on-time
        testDeployedTimestamp = block.timestamp;
    }

    /// @dev Tests `_goToNextEpoch`.
    ///      Configures internal variables such taht `epochEndTime` will be
    ///      less-than, equal-to, or greater-than the block timestamp.
    /// @param epochEndTimeDelta Set to desired `epochEndTime - block.timestamp`
    function goToNextEpochTest(int256 epochEndTimeDelta)
        public
    {
        // solhint-disable-next-line not-rely-on-time
        uint256 blockTimestamp = block.timestamp;

        // Emit info used by client-side test code
        emit GoToNextEpochTestInfo(
            currentEpoch,
            blockTimestamp
        );

        // (i) In `_goToNextEpoch` we compute:
        //     `epochEndTime = currentEpochStartTimeInSeconds + epochDurationInSeconds`
        // (ii) We want adjust internal state such that:
        //      `epochEndTime - block.timestamp = epochEndTimeDelta`, or
        //      `currentEpochStartTimeInSeconds + epochDurationInSeconds - block.timestamp = epochEndTimeDelta`
        //
        // To do this, we:
        //  (i) Set `epochDurationInSeconds` to a constant value of 1, and
        //  (ii) Rearrange the eqn above to get:
        //      `currentEpochStartTimeInSeconds = epochEndTimeDelta + block.timestamp - epochDurationInSeconds`
        epochDurationInSeconds = 1;
        currentEpochStartTimeInSeconds =
            uint256(epochEndTimeDelta + int256(blockTimestamp) - int256(epochDurationInSeconds));

        // Test internal function
        _goToNextEpoch();
    }

    /// @dev Tests `_initMixinScheduler`
    /// @param _currentEpochStartTimeInSeconds Sets `currentEpochStartTimeInSeconds` to this value before test.
    function initMixinSchedulerTest(uint256 _currentEpochStartTimeInSeconds)
        public
    {
        currentEpochStartTimeInSeconds = _currentEpochStartTimeInSeconds;
        _initMixinScheduler();
    }
}
function goToNextEpochTest(int256 epochEndTimeDelta)
    public
{
    // solhint-disable-next-line not-rely-on-time
    uint256 blockTimestamp = block.timestamp;

    // Emit info used by client-side test code
    emit GoToNextEpochTestInfo(
        currentEpoch,
        blockTimestamp
    );

    // (i) In `_goToNextEpoch` we compute:
    //     `epochEndTime = currentEpochStartTimeInSeconds + epochDurationInSeconds`
    // (ii) We want adjust internal state such that:
    //      `epochEndTime - block.timestamp = epochEndTimeDelta`, or
    //      `currentEpochStartTimeInSeconds + epochDurationInSeconds - block.timestamp = epochEndTimeDelta`
    //
    // To do this, we:
    //  (i) Set `epochDurationInSeconds` to a constant value of 1, and
    //  (ii) Rearrange the eqn above to get:
    //      `currentEpochStartTimeInSeconds = epochEndTimeDelta + block.timestamp - epochDurationInSeconds`
    epochDurationInSeconds = 1;
    currentEpochStartTimeInSeconds =
        uint256(epochEndTimeDelta + int256(blockTimestamp) - int256(epochDurationInSeconds));

    // Test internal function
    _goToNextEpoch();
}

/// @dev Tests `_goToNextEpoch`.
///      Configures internal variables such taht `epochEndTime` will be
///      less-than, equal-to, or greater-than the block timestamp.
/// @param epochEndTimeDelta Set to desired `epochEndTime - block.timestamp`