Files
core/contracts/mocks/MockFollowModuleWithRevertFlag.sol
2023-01-05 20:43:11 -03:00

33 lines
845 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import {IFollowModule} from '../interfaces/IFollowModule.sol';
/**
* @dev This is a simple mock follow module to be used for testing revert cases on processFollow.
*/
contract MockFollowModuleWithRevertFlag is IFollowModule {
error MockFollowModuleReverted();
function initializeFollowModule(
uint256 profileId,
address executor,
bytes calldata data
) external pure override returns (bytes memory) {
return new bytes(0);
}
function processFollow(
uint256 followerProfileId,
uint256 followTokenId,
address executor,
uint256 profileId,
bytes calldata data
) external pure override {
if (abi.decode(data, (bool))) {
revert MockFollowModuleReverted();
}
}
}