// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import 'test/base/BaseTest.t.sol';

// A contraption to quickly investigate onchain actions
contract TestTest is BaseTest {
    using stdJson for string;

    function setUp() public override {
        super.setUp();

        address newLensHub = address(
            new LensHubInitializable({
                followNFTImpl: 0x535FDf959f86E95eB95d03E112fb7CFA2Bf4fE15,
                collectNFTImpl: 0x0000000000000000000000000000000000000000,
                moduleRegistry: 0x8834aE494ADD3C56d274Fe88243526DBAB15dEF8,
                tokenGuardianCooldown: 300,
                migrationParams: Types.MigrationParams({
                    lensHandlesAddress: address(0),
                    tokenHandleRegistryAddress: address(0),
                    legacyFeeFollowModule: address(0),
                    legacyProfileFollowModule: address(0),
                    newFeeFollowModule: address(0)
                })
            })
        );

        vm.etch(0xEA0563b6Af1Af7B9b132Be335a518b41cFf35536, newLensHub.code);
    }

    /**
    function testTestPost() public onlyFork {
        bytes
            memory rawCalldata = hex'[encoded data, 4992 characters]';
        Types.PostParams memory postParams = abi.decode(rawCalldata, (Types.PostParams));
        console.log('postParams:');
        console.log('\tprofileId: %s', postParams.profileId);
        console.log('\tcontentURI: %s', postParams.contentURI);
        console.log('\tactionModules.length: %s', postParams.actionModules.length);
        if (postParams.actionModules.length > 0) {
            console.log('\tactionModules[0]: %s', postParams.actionModules[0]);
        }
        console.log('\tactionModulesInitDatas.length: %s', postParams.actionModulesInitDatas.length);
        if (postParams.actionModulesInitDatas.length > 0) {
            console.log('\tactionModulesInitDatas[0]:');
            // console.logBytes(postParams.actionModulesInitDatas[0]);

            (
                uint8 donHostedSecretsSlotID,
                uint64 donHostedSecretsVersion,
                bytes32 percentageOff,
                uint64 quantityAvailable
            ) = abi.decode(postParams.actionModulesInitDatas[0], (uint8, uint64, bytes32, uint64));
            console.log('\t\tdonHostedSecretsSlotID: %s', donHostedSecretsSlotID);
            console.log('\t\tdonHostedSecretsVersion: %s', donHostedSecretsVersion);
            console.log('\t\tpercentageOff:');
            console.logBytes32(percentageOff);
            console.log('\t\tquantityAvailable: %s', quantityAvailable);
        }
        console.log('\treferenceModule: %s', postParams.referenceModule);
        console.log('\treferenceModuleInitData:');

        postParams.actionModules[0] = 0xFB0A0BC7feB519a3Ddd0efa970EAe0d9dE7976CA;

        address guy = 0x6C1e1bC39b13f9E0Af9424D76De899203F47755F;
        vm.prank(guy);
        hub.post(postParams);
    }
    */

    /**
    function testCommentWithoutReferenceModule() public onlyFork {
        bytes
            memory rawCalldata = hex'0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d5866525258737774747655775a734c564d7a4552394b6841654e76686a3371695076697a3563384e716d5a63000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000015000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
        Types.CommentParams memory commentParams = abi.decode(rawCalldata, (Types.CommentParams));
        console.log('commentParams:');
        console.log('\tprofileId: %s', commentParams.profileId);
        console.log('\tcontentURI: %s', commentParams.contentURI);
        console.log('\tpointedProfileId: %s', commentParams.pointedProfileId);
        console.log('\tpointedPubId: %s', commentParams.pointedPubId);
        console.log('\treferrerProfileIds.length: %s', commentParams.referrerProfileIds.length);
        if (commentParams.referrerProfileIds.length > 0) {
            console.log('\treferrerProfileIds[0]: %s', commentParams.referrerProfileIds[0]);
        }
        console.log('\treferrerPubIds.length: %s', commentParams.referrerPubIds.length);
        if (commentParams.referrerPubIds.length > 0) {
            console.log('\treferrerPubIds[0]: %s', commentParams.referrerPubIds[0]);
        }
        console.log('\treferenceModuleData:');
        console.logBytes(commentParams.referenceModuleData);
        console.log('\tactionModules.length: %s', commentParams.actionModules.length);
        if (commentParams.actionModules.length > 0) {
            console.log('\tactionModules[0]: %s', commentParams.actionModules[0]);
        }
        console.log('\tactionModulesInitDatas.length: %s', commentParams.actionModulesInitDatas.length);
        if (commentParams.actionModulesInitDatas.length > 0) {
            console.log('\tactionModulesInitDatas[0]:');
            console.logBytes(commentParams.actionModulesInitDatas[0]);
        }
        console.log('\treferenceModule: %s', commentParams.referenceModule);
        console.log('\treferenceModuleInitData:');
        console.logBytes(commentParams.referenceModuleInitData);

        address guy = 0x6C1e1bC39b13f9E0Af9424D76De899203F47755F;
        vm.prank(guy);
        hub.comment(commentParams);
    }
    */
}
