Skip to content

Commit fdf5f79

Browse files
committed
chore: linting
Signed-off-by: Tomás Migone <[email protected]>
1 parent 9a74331 commit fdf5f79

File tree

3 files changed

+41
-11
lines changed

3 files changed

+41
-11
lines changed

packages/subgraph-service/test/mocks/MockRewardsManager.sol

+10-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ interface IRewardsIssuer {
1414
)
1515
external
1616
view
17-
returns (bool isActive, address indexer, bytes32 subgraphDeploymentId, uint256 tokens, uint256 accRewardsPerAllocatedToken);
17+
returns (
18+
bool isActive,
19+
address indexer,
20+
bytes32 subgraphDeploymentId,
21+
uint256 tokens,
22+
uint256 accRewardsPerAllocatedToken
23+
);
1824
}
1925

2026
contract MockRewardsManager is IRewardsManager {
@@ -71,13 +77,12 @@ contract MockRewardsManager is IRewardsManager {
7177

7278
function takeRewards(address _allocationID) external returns (uint256) {
7379
address rewardsIssuer = msg.sender;
74-
(bool isActive, , , uint256 tokens, uint256 accRewardsPerAllocatedToken) = IRewardsIssuer(rewardsIssuer).getAllocationData(
75-
_allocationID
76-
);
80+
(bool isActive, , , uint256 tokens, uint256 accRewardsPerAllocatedToken) = IRewardsIssuer(rewardsIssuer)
81+
.getAllocationData(_allocationID);
7782

7883
if (!isActive) {
7984
return 0;
80-
}
85+
}
8186

8287
uint256 accRewardsPerTokens = tokens.mulPPM(rewardsPerSignal);
8388
uint256 rewards = accRewardsPerTokens - accRewardsPerAllocatedToken;

packages/subgraph-service/test/subgraphService/SubgraphService.t.sol

+8-2
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ contract SubgraphServiceTest is SubgraphServiceSharedTest {
278278
address _indexer,
279279
bytes memory _data
280280
) private returns (uint256 paymentCollected) {
281-
(IGraphTallyCollector.SignedRAV memory signedRav, uint256 tokensToCollect) = abi.decode(_data, (IGraphTallyCollector.SignedRAV, uint256));
281+
(IGraphTallyCollector.SignedRAV memory signedRav, uint256 tokensToCollect) = abi.decode(
282+
_data,
283+
(IGraphTallyCollector.SignedRAV, uint256)
284+
);
282285
address allocationId = address(uint160(uint256(signedRav.rav.collectionId)));
283286
Allocation.State memory allocation = subgraphService.getAllocation(allocationId);
284287
bytes32 subgraphDeploymentId = allocation.subgraphDeploymentId;
@@ -370,7 +373,10 @@ contract SubgraphServiceTest is SubgraphServiceSharedTest {
370373
CollectPaymentData memory collectPaymentDataBefore,
371374
CollectPaymentData memory collectPaymentDataAfter
372375
) private view {
373-
(IGraphTallyCollector.SignedRAV memory signedRav, uint256 tokensToCollect) = abi.decode(_data, (IGraphTallyCollector.SignedRAV, uint256));
376+
(IGraphTallyCollector.SignedRAV memory signedRav, uint256 tokensToCollect) = abi.decode(
377+
_data,
378+
(IGraphTallyCollector.SignedRAV, uint256)
379+
);
374380
Allocation.State memory allocation = subgraphService.getAllocation(
375381
address(uint160(uint256(signedRav.rav.collectionId)))
376382
);

packages/subgraph-service/test/subgraphService/collect/query/query.t.sol

+23-4
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ contract SubgraphServiceRegisterTest is SubgraphServiceTest {
213213
_authorizeSigner();
214214

215215
uint256 beforeGatewayBalance = escrow.getBalance(users.gateway, address(graphTallyCollector), users.indexer);
216-
uint256 beforeTokensCollected = graphTallyCollector.tokensCollected(address(subgraphService), bytes32(uint256(uint160(allocationID))), users.indexer, users.gateway);
216+
uint256 beforeTokensCollected = graphTallyCollector.tokensCollected(
217+
address(subgraphService),
218+
bytes32(uint256(uint160(allocationID))),
219+
users.indexer,
220+
users.gateway
221+
);
217222

218223
// Collect the RAV in two steps
219224
resetPrank(users.indexer);
@@ -222,9 +227,18 @@ contract SubgraphServiceRegisterTest is SubgraphServiceTest {
222227
bytes memory data = _getQueryFeeEncodedData(users.indexer, uint128(tokensPayment), tokensToCollect);
223228
_collect(users.indexer, IGraphPayments.PaymentTypes.QueryFee, data);
224229

225-
uint256 intermediateGatewayBalance = escrow.getBalance(users.gateway, address(graphTallyCollector), users.indexer);
230+
uint256 intermediateGatewayBalance = escrow.getBalance(
231+
users.gateway,
232+
address(graphTallyCollector),
233+
users.indexer
234+
);
226235
assertEq(intermediateGatewayBalance, beforeGatewayBalance - tokensToCollect);
227-
uint256 intermediateTokensCollected = graphTallyCollector.tokensCollected(address(subgraphService), bytes32(uint256(uint160(allocationID))), users.indexer, users.gateway);
236+
uint256 intermediateTokensCollected = graphTallyCollector.tokensCollected(
237+
address(subgraphService),
238+
bytes32(uint256(uint160(allocationID))),
239+
users.indexer,
240+
users.gateway
241+
);
228242
assertEq(intermediateTokensCollected, beforeTokensCollected + tokensToCollect);
229243

230244
bytes memory data2 = _getQueryFeeEncodedData(
@@ -237,7 +251,12 @@ contract SubgraphServiceRegisterTest is SubgraphServiceTest {
237251
// Check the indexer received the correct amount of tokens
238252
uint256 afterGatewayBalance = escrow.getBalance(users.gateway, address(graphTallyCollector), users.indexer);
239253
assertEq(afterGatewayBalance, beforeGatewayBalance - tokensPayment);
240-
uint256 afterTokensCollected = graphTallyCollector.tokensCollected(address(subgraphService), bytes32(uint256(uint160(allocationID))), users.indexer, users.gateway);
254+
uint256 afterTokensCollected = graphTallyCollector.tokensCollected(
255+
address(subgraphService),
256+
bytes32(uint256(uint160(allocationID))),
257+
users.indexer,
258+
users.gateway
259+
);
241260
assertEq(afterTokensCollected, intermediateTokensCollected + tokensToCollect + (oddTokensPayment ? 1 : 0));
242261
}
243262
}

0 commit comments

Comments
 (0)