Skip to content

Commit

Permalink
Merge pull request #1040 from graphprotocol/fix_oz_n-10
Browse files Browse the repository at this point in the history
fix: remove unused return values. (OZ N-10)
  • Loading branch information
MoonBoi9001 authored Sep 19, 2024
2 parents 4387c6c + bd62e95 commit 54286e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
19 changes: 4 additions & 15 deletions packages/subgraph-service/contracts/libraries/Allocation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ library Allocation {
* @param self The allocation list mapping
* @param allocationId The allocation id
*/
function presentPOI(mapping(address => State) storage self, address allocationId) internal returns (State memory) {
function presentPOI(mapping(address => State) storage self, address allocationId) internal {
State storage allocation = _get(self, allocationId);
require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt));
allocation.lastPOIPresentedAt = block.timestamp;

return allocation;
}

/**
Expand All @@ -116,12 +114,10 @@ library Allocation {
mapping(address => State) storage self,
address allocationId,
uint256 accRewardsPerAllocatedToken
) internal returns (State memory) {
) internal {
State storage allocation = _get(self, allocationId);
require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt));
allocation.accRewardsPerAllocatedToken = accRewardsPerAllocatedToken;

return allocation;
}

/**
Expand All @@ -131,15 +127,10 @@ library Allocation {
* @param self The allocation list mapping
* @param allocationId The allocation id
*/
function clearPendingRewards(
mapping(address => State) storage self,
address allocationId
) internal returns (State memory) {
function clearPendingRewards(mapping(address => State) storage self, address allocationId) internal {
State storage allocation = _get(self, allocationId);
require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt));
allocation.accRewardsPending = 0;

return allocation;
}

/**
Expand All @@ -149,12 +140,10 @@ library Allocation {
* @param self The allocation list mapping
* @param allocationId The allocation id
*/
function close(mapping(address => State) storage self, address allocationId) internal returns (State memory) {
function close(mapping(address => State) storage self, address allocationId) internal {
State storage allocation = _get(self, allocationId);
require(allocation.isOpen(), AllocationClosed(allocationId, allocation.closedAt));
allocation.closedAt = block.timestamp;

return allocation;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
*
* @param _allocationId The id of the allocation to be closed
*/
function _closeAllocation(address _allocationId) internal returns (Allocation.State memory) {
function _closeAllocation(address _allocationId) internal {
Allocation.State memory allocation = allocations.get(_allocationId);

// Take rewards snapshot to prevent other allos from counting tokens from this allo
Expand All @@ -414,7 +414,6 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
allocation.tokens;

emit AllocationClosed(allocation.indexer, _allocationId, allocation.subgraphDeploymentId, allocation.tokens);
return allocations[_allocationId];
}

/**
Expand Down

0 comments on commit 54286e3

Please sign in to comment.