// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import { Test } from "forge-std/Test.sol";
import {
    BasePilotAccessControllerV3,
    BasePilotAccessControllerCoreV3
} from "../../contracts/pilot/BasePilotAccessControllerV3.sol";
import {
    BaseSepoliaRehearsalAccessControllerV3
} from "../../contracts/pilot/BaseSepoliaRehearsalAccessControllerV3.sol";

/// @notice The rehearsal profile must be a distinct immutable deployment path.
contract BaseSepoliaRehearsalAccessControllerV3Test is Test {
    function testSepoliaProfileOnlyDeploysOn84532() external {
        vm.chainId(84532);
        BaseSepoliaRehearsalAccessControllerV3 controller =
            new BaseSepoliaRehearsalAccessControllerV3(address(this), 2 ether, 1 ether);
        assertEq(controller.requiredChainId(), 84532);
        assertFalse(controller.deployEnabled());
        assertFalse(controller.writeEnabled());

        vm.expectRevert(BasePilotAccessControllerCoreV3.UnsupportedChain.selector);
        new BasePilotAccessControllerV3(address(this), 2 ether, 1 ether);
    }

    function testSepoliaProfileRejectsBaseMainnet() external {
        vm.chainId(8453);
        vm.expectRevert(BasePilotAccessControllerCoreV3.UnsupportedChain.selector);
        new BaseSepoliaRehearsalAccessControllerV3(address(this), 2 ether, 1 ether);
    }
}
