Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update mock custom entitlement to take in users and params #1013

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ pragma solidity ^0.8.23;
import {Deployer} from "contracts/scripts/common/Deployer.s.sol";
import {MockCustomEntitlement} from "contracts/test/mocks/MockCustomEntitlement.sol";

contract DeployCustomEntitlementExample is Deployer {
contract DeployMockCustomEntitlement is Deployer {
function versionName() public pure override returns (string memory) {
return "customEntitlementExample";
return "mockCustomEntitlement";
}

function __deploy(address deployer) public override returns (address) {
Expand Down
9 changes: 9 additions & 0 deletions contracts/src/spaces/entitlements/ICustomEntitlement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@ interface ICustomEntitlement is IERC165 {
/// @param user address of the user to check
/// @return whether the user is entitled to the permission
function isEntitled(address[] memory user) external view returns (bool);

/// @notice checks whether a user is has a given permission for a channel or a space
/// @param users addresses of the users to check
/// @param entitledData data to pass to the entitlement check
/// @return whether the user is entitled to the permission
function isEntitled(
address[] memory users,
bytes memory entitledData
) external view returns (bool);
}
7 changes: 7 additions & 0 deletions contracts/test/mocks/MockCustomEntitlement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ contract MockCustomEntitlement is ICustomEntitlement {
return false;
}

function isEntitled(
address[] memory,
bytes memory
) external pure override returns (bool) {
return true;
}

function supportsInterface(
bytes4 interfaceId
) public view virtual override returns (bool) {
Expand Down
Loading