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

import "../AereEthLightClient.sol";
import "../lib/BLS12381.sol";
import "../lib/SSZ.sol";

/**
 * @title LightClientHarness — TEST-ONLY. Exposes AereEthLightClient internals and a
 *        few BLS/SSZ primitives so tests can assert the on-chain computations match an
 *        independent JS reference byte-for-byte. Not for deployment.
 */
contract LightClientHarness is AereEthLightClient {
    constructor(
        bytes memory dst_,
        bytes32 gvr_,
        bytes32 bootstrapCommitteeRoot,
        BeaconHeader memory bootstrapFinalized
    ) AereEthLightClient(dst_, gvr_, bootstrapCommitteeRoot, bootstrapFinalized) {}

    function h_committeeRoot(bytes calldata pk, bytes calldata agg) external view returns (bytes32) {
        return _syncCommitteeRoot(pk, agg);
    }

    function h_domain(bytes4 fv) external view returns (bytes32) {
        return _computeDomain(fv);
    }

    function h_headerRoot(BeaconHeader calldata hd) external view returns (bytes32) {
        return _headerRoot(hd);
    }

    function h_compress(bytes calldata pk) external pure returns (bytes memory) {
        return _compressCalldata(pk);
    }

    function h_hashToG2(bytes calldata message) external view returns (bytes memory) {
        return BLS12381.hashToG2(message, dst);
    }

    function h_merkleBranch(
        bytes32 leaf,
        bytes32[] calldata branch,
        uint256 depth,
        uint256 index,
        bytes32 root
    ) external view returns (bool) {
        return SSZ.isValidMerkleBranch(leaf, branch, depth, index, root);
    }
}
