Skip to content

Commit

Permalink
misc: processRemovePost renamed to processDeletePost
Browse files Browse the repository at this point in the history
  • Loading branch information
vicnaum committed Jan 18, 2025
1 parent 96c48f6 commit f458e57
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion contracts/core/interfaces/IFeedRule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface IFeedRule {
KeyValue[] calldata ruleParams
) external;

function processRemovePost(
function processDeletePost(
bytes32 configSalt,
uint256 postId,
KeyValue[] calldata primitiveParams,
Expand Down
2 changes: 1 addition & 1 deletion contracts/core/primitives/feed/Feed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ contract Feed is
address author = Core.$storage().posts[postId].author;
require(msg.sender == author || _hasAccess(msg.sender, PID__REMOVE_POST), Errors.InvalidMsgSender());
Core._removePost(postId);
_processPostRemoval(postId, customParams, feedRulesParams);
_processPostDeletion(postId, customParams, feedRulesParams);
address source = _processSourceStamp(postId, customParams);
emit Lens_Feed_PostDeleted(postId, author, customParams, source);
}
Expand Down
10 changes: 5 additions & 5 deletions contracts/core/primitives/feed/RuleBasedFeed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ abstract contract RuleBasedFeed is IFeed, RuleBasedPrimitive {
bytes4[] memory selectors = new bytes4[](4);
selectors[0] = IFeedRule.processCreatePost.selector;
selectors[1] = IFeedRule.processEditPost.selector;
selectors[2] = IFeedRule.processRemovePost.selector;
selectors[2] = IFeedRule.processDeletePost.selector;
selectors[3] = IFeedRule.processPostRuleChanges.selector;
return selectors;
}
Expand Down Expand Up @@ -417,20 +417,20 @@ abstract contract RuleBasedFeed is IFeed, RuleBasedPrimitive {
require(_rulesStorage.anyOfRules[processParams.ruleSelector].length == 0, Errors.AllAnyOfRulesReverted());
}

function _processPostRemoval(
function _processPostDeletion(
uint256 postId,
KeyValue[] calldata customParams,
RuleProcessingParams[] calldata rulesProcessingParams
) internal {
bytes4 ruleSelector = IFeedRule.processRemovePost.selector;
bytes4 ruleSelector = IFeedRule.processDeletePost.selector;
Rule memory rule;
KeyValue[] memory ruleParams;
// Check required rules (AND-combined rules)
for (uint256 i = 0; i < $feedRulesStorage().requiredRules[ruleSelector].length; i++) {
rule = $feedRulesStorage().requiredRules[ruleSelector][i];
ruleParams = _getRuleParamsOrEmptyArray(rule, rulesProcessingParams);
(bool callSucceeded,) = rule.ruleAddress.safecall(
abi.encodeCall(IFeedRule.processRemovePost, (rule.configSalt, postId, customParams, ruleParams))
abi.encodeCall(IFeedRule.processDeletePost, (rule.configSalt, postId, customParams, ruleParams))
);
require(callSucceeded, Errors.RequiredRuleReverted());
}
Expand All @@ -439,7 +439,7 @@ abstract contract RuleBasedFeed is IFeed, RuleBasedPrimitive {
rule = $feedRulesStorage().anyOfRules[ruleSelector][i];
ruleParams = _getRuleParamsOrEmptyArray(rule, rulesProcessingParams);
(bool callSucceeded,) = rule.ruleAddress.safecall(
abi.encodeCall(IFeedRule.processRemovePost, (rule.configSalt, postId, customParams, ruleParams))
abi.encodeCall(IFeedRule.processDeletePost, (rule.configSalt, postId, customParams, ruleParams))
);
if (callSucceeded) {
return; // If any of the OR-combined rules passed, it means they succeed and we can return
Expand Down
2 changes: 1 addition & 1 deletion contracts/rules/base/AccountBlockingRule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ contract AccountBlockingRule is IFeedRule, IGraphRule, MetadataBased {
revert Errors.NotImplemented();
}

function processRemovePost(
function processDeletePost(
bytes32, /* configSalt */
uint256, /* postId */
KeyValue[] calldata, /* primitiveCustomParams */
Expand Down
2 changes: 1 addition & 1 deletion contracts/rules/feed/GroupGatedFeedRule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ contract GroupGatedFeedRule is IFeedRule, MetadataBased {
revert Errors.NotImplemented();
}

function processRemovePost(
function processDeletePost(
bytes32, /* configSalt */
uint256, /* postId */
KeyValue[] calldata, /* primitiveParams */
Expand Down
4 changes: 2 additions & 2 deletions contracts/rules/feed/RestrictedSignersFeedRule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ contract RestrictedSignersFeedRule is RestrictedSignersRule, IFeedRule {
});
}

function processRemovePost(
function processDeletePost(
bytes32 configSalt,
uint256 postId,
KeyValue[] calldata primitiveParams,
KeyValue[] calldata ruleParams
) external override {
_validateRestrictedSignerMessage({
configSalt: configSalt,
functionSelector: IFeedRule.processRemovePost.selector,
functionSelector: IFeedRule.processDeletePost.selector,
abiEncodedFunctionParams: abi.encode(postId, EIP712EncodingLib.encodeForEIP712(primitiveParams)),
signature: abi.decode(ruleParams[0].value, (EIP712Signature))
});
Expand Down
2 changes: 1 addition & 1 deletion contracts/rules/feed/SimplePaymentFeedRule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ contract SimplePaymentFeedRule is SimplePaymentRule, IFeedRule {
revert Errors.NotImplemented();
}

function processRemovePost(
function processDeletePost(
bytes32, /* configSalt */
uint256, /* postId */
KeyValue[] calldata, /* primitiveParams */
Expand Down
2 changes: 1 addition & 1 deletion contracts/rules/feed/TokenGatedFeedRule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ contract TokenGatedFeedRule is TokenGatedRule, IFeedRule {
revert Errors.NotImplemented();
}

function processRemovePost(
function processDeletePost(
bytes32, /* configSalt */
uint256, /* postId */
KeyValue[] calldata, /* primitiveParams */
Expand Down

0 comments on commit f458e57

Please sign in to comment.