Skip to content

Commit 1eb4250

Browse files
committed
ci: lint and format
Signed-off-by: Tomás Migone <[email protected]>
1 parent 31a1275 commit 1eb4250

File tree

19 files changed

+49
-76
lines changed

19 files changed

+49
-76
lines changed

.devcontainer/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ The dev container provides a consistent development environment with caching to
2121
The container uses a conservative caching approach to prevent cache corruption issues:
2222

2323
1. **Local Cache Directories**: Each container instance maintains its own cache directories
24-
2524
- `vscode-cache``/home/vscode/.cache` (VS Code cache)
2625
- `vscode-config``/home/vscode/.config` (VS Code configuration)
2726
- `vscode-data``/home/vscode/.local/share` (VS Code data)
2827
- `vscode-bin``/home/vscode/.local/bin` (User binaries)
2928

3029
2. **Safe Caches Only**: Only caches that won't cause cross-branch issues are configured
31-
3230
- GitHub CLI: `/home/vscode/.cache/github`
3331
- Python packages: `/home/vscode/.cache/pip`
3432

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@
3333

3434
This repository is a pnpm workspaces monorepo containing the following packages:
3535

36-
| Package | Latest version | Description |
37-
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
38-
| [contracts](./packages/contracts) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fcontracts.svg)](https://badge.fury.io/js/@graphprotocol%2Fcontracts) | Contracts enabling the open and permissionless decentralized network known as The Graph protocol. |
39-
| [data-edge](./packages/data-edge) | - | Data edge testing and utilities for The Graph protocol. |
40-
| [hardhat-graph-protocol](./packages/hardhat-graph-protocol) | [![npm version](https://badge.fury.io/js/hardhat-graph-protocol.svg)](https://badge.fury.io/js/hardhat-graph-protocol) | A Hardhat plugin that extends the runtime environment with functionality for The Graph protocol. |
41-
| [horizon](./packages/horizon) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fhorizon.svg)](https://badge.fury.io/js/@graphprotocol%2Fhorizon) | Contracts for Graph Horizon, the next iteration of The Graph protocol. |
42-
| [interfaces](./packages/interfaces) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Finterfaces.svg)](https://badge.fury.io/js/@graphprotocol%2Finterfaces) | Contract interfaces for The Graph protocol contracts. |
43-
| [subgraph-service](./packages/subgraph-service) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fsubgraph-service.svg)](https://badge.fury.io/js/@graphprotocol%2Fsubgraph-service) | Contracts for the Subgraph data service in Graph Horizon. |
44-
| [token-distribution](./packages/token-distribution) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution.svg)](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution) | Contracts managing token locks for network participants. |
45-
| [toolshed](./packages/toolshed) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Ftoolshed.svg)](https://badge.fury.io/js/@graphprotocol%2Ftoolshed) | A collection of tools and utilities for the Graph Protocol TypeScript components. |
36+
| Package | Latest version | Description |
37+
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
38+
| [contracts](./packages/contracts) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fcontracts.svg)](https://badge.fury.io/js/@graphprotocol%2Fcontracts) | Contracts enabling the open and permissionless decentralized network known as The Graph protocol. |
39+
| [data-edge](./packages/data-edge) | - | Data edge testing and utilities for The Graph protocol. |
40+
| [hardhat-graph-protocol](./packages/hardhat-graph-protocol) | [![npm version](https://badge.fury.io/js/hardhat-graph-protocol.svg)](https://badge.fury.io/js/hardhat-graph-protocol) | A Hardhat plugin that extends the runtime environment with functionality for The Graph protocol. |
41+
| [horizon](./packages/horizon) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fhorizon.svg)](https://badge.fury.io/js/@graphprotocol%2Fhorizon) | Contracts for Graph Horizon, the next iteration of The Graph protocol. |
42+
| [interfaces](./packages/interfaces) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Finterfaces.svg)](https://badge.fury.io/js/@graphprotocol%2Finterfaces) | Contract interfaces for The Graph protocol contracts. |
43+
| [subgraph-service](./packages/subgraph-service) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fsubgraph-service.svg)](https://badge.fury.io/js/@graphprotocol%2Fsubgraph-service) | Contracts for the Subgraph data service in Graph Horizon. |
44+
| [token-distribution](./packages/token-distribution) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution.svg)](https://badge.fury.io/js/@graphprotocol%2Ftoken-distribution) | Contracts managing token locks for network participants. |
45+
| [toolshed](./packages/toolshed) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Ftoolshed.svg)](https://badge.fury.io/js/@graphprotocol%2Ftoolshed) | A collection of tools and utilities for the Graph Protocol TypeScript components. |
4646

4747
## Development
4848

natspec-smells.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
/** @type {import('@defi-wonderland/natspec-smells').Config} */
1313
module.exports = {
1414
include: [
15-
'packages/issuance/contracts/**/*.sol',
15+
'packages/issuance/contracts/**/*.sol',
1616
'packages/interfaces/contracts/**/*.sol',
1717
'packages/horizon/contracts/**/*.sol',
18-
'packages/subgraph-service/contracts/**/*.sol'
18+
'packages/subgraph-service/contracts/**/*.sol',
1919
],
2020

2121
root: './',

packages/contracts/contracts/rewards/RewardsManager.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { GraphUpgradeable } from "../upgrades/GraphUpgradeable.sol";
99
import { Managed } from "../governance/Managed.sol";
1010
import { MathUtils } from "../staking/libs/MathUtils.sol";
1111
import { IGraphToken } from "../token/IGraphToken.sol";
12-
import { IStaking, IStakingBase } from "../staking/IStaking.sol";
1312

1413
import { RewardsManagerV5Storage } from "./RewardsManagerStorage.sol";
1514
import { IRewardsManager } from "./IRewardsManager.sol";

packages/horizon/contracts/staking/HorizonStaking.sol

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ pragma solidity 0.8.27;
44

55
import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol";
66
import { IHorizonStakingMain } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingMain.sol";
7-
import {
8-
IHorizonStakingExtension
9-
} from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingExtension.sol";
7+
import { IHorizonStakingExtension } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingExtension.sol";
108
import { IGraphPayments } from "@graphprotocol/interfaces/contracts/horizon/IGraphPayments.sol";
119
import { ILinkedList } from "@graphprotocol/interfaces/contracts/horizon/internal/ILinkedList.sol";
1210

@@ -460,11 +458,9 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
460458

461459
// Service provider accounting
462460
_serviceProviders[serviceProvider].tokensProvisioned =
463-
_serviceProviders[serviceProvider].tokensProvisioned -
464-
providerTokensSlashed;
461+
_serviceProviders[serviceProvider].tokensProvisioned - providerTokensSlashed;
465462
_serviceProviders[serviceProvider].tokensStaked =
466-
_serviceProviders[serviceProvider].tokensStaked -
467-
providerTokensSlashed;
463+
_serviceProviders[serviceProvider].tokensStaked - providerTokensSlashed;
468464

469465
emit ProvisionSlashed(serviceProvider, verifier, providerTokensSlashed);
470466
}
@@ -747,8 +743,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
747743

748744
prov.tokens = prov.tokens + _tokens;
749745
_serviceProviders[_serviceProvider].tokensProvisioned =
750-
_serviceProviders[_serviceProvider].tokensProvisioned +
751-
_tokens;
746+
_serviceProviders[_serviceProvider].tokensProvisioned + _tokens;
752747
emit ProvisionIncreased(_serviceProvider, _verifier, _tokens);
753748
}
754749

packages/horizon/contracts/staking/HorizonStakingExtension.sol

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ pragma solidity 0.8.27;
44

55
import { ICuration } from "@graphprotocol/interfaces/contracts/contracts/curation/ICuration.sol";
66
import { IGraphToken } from "@graphprotocol/contracts/contracts/token/IGraphToken.sol";
7-
import {
8-
IHorizonStakingExtension
9-
} from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingExtension.sol";
7+
import { IHorizonStakingExtension } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingExtension.sol";
108
import { IRewardsIssuer } from "@graphprotocol/interfaces/contracts/contracts/rewards/IRewardsIssuer.sol";
119

1210
import { TokenUtils } from "@graphprotocol/contracts/contracts/utils/TokenUtils.sol";
@@ -366,14 +364,12 @@ contract HorizonStakingExtension is HorizonStakingBase, IHorizonStakingExtension
366364

367365
// Free allocated tokens from use
368366
_serviceProviders[alloc.indexer].__DEPRECATED_tokensAllocated =
369-
_serviceProviders[alloc.indexer].__DEPRECATED_tokensAllocated -
370-
alloc.tokens;
367+
_serviceProviders[alloc.indexer].__DEPRECATED_tokensAllocated - alloc.tokens;
371368

372369
// Track total allocations per subgraph
373370
// Used for rewards calculations
374371
__DEPRECATED_subgraphAllocations[alloc.subgraphDeploymentID] =
375-
__DEPRECATED_subgraphAllocations[alloc.subgraphDeploymentID] -
376-
alloc.tokens;
372+
__DEPRECATED_subgraphAllocations[alloc.subgraphDeploymentID] - alloc.tokens;
377373
}
378374

379375
// Close the allocation

packages/horizon/contracts/staking/HorizonStakingStorage.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
pragma solidity 0.8.27;
44

5-
import {
6-
IHorizonStakingExtension
7-
} from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingExtension.sol";
5+
import { IHorizonStakingExtension } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingExtension.sol";
86
import { IHorizonStakingTypes } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingTypes.sol";
97
import { IGraphPayments } from "@graphprotocol/interfaces/contracts/horizon/IGraphPayments.sol";
108
import { ILinkedList } from "@graphprotocol/interfaces/contracts/horizon/internal/ILinkedList.sol";

packages/horizon/test/unit/data-service/extensions/DataServiceFees.t.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ contract DataServiceFeesTest is HorizonStakingSharedTest {
6666
// tryna lock some more
6767
uint256 additionalTokens = 10000;
6868
uint256 tokensRequired = dataService.feesProvisionTracker(users.indexer) +
69-
additionalTokens *
70-
dataService.STAKE_TO_FEES_RATIO();
69+
additionalTokens * dataService.STAKE_TO_FEES_RATIO();
7170
uint256 tokensAvailable = staking.getTokensAvailable(users.indexer, address(dataService), 0);
7271
vm.expectRevert(
7372
abi.encodeWithSelector(

packages/horizon/test/unit/data-service/implementations/DataServiceImpPausableUpgradeable.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
pragma solidity 0.8.27;
33

44
import { DataService } from "../../../../contracts/data-service/DataService.sol";
5-
import {
6-
DataServicePausableUpgradeable
7-
} from "../../../../contracts/data-service/extensions/DataServicePausableUpgradeable.sol";
5+
import { DataServicePausableUpgradeable } from "../../../../contracts/data-service/extensions/DataServicePausableUpgradeable.sol";
86
import { IGraphPayments } from "@graphprotocol/interfaces/contracts/horizon/IGraphPayments.sol";
97

108
contract DataServiceImpPausableUpgradeable is DataServicePausableUpgradeable {

packages/horizon/test/unit/shared/horizon-staking/HorizonStakingShared.t.sol

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { GraphBaseTest } from "../../GraphBase.t.sol";
77
import { IGraphPayments } from "@graphprotocol/interfaces/contracts/horizon/IGraphPayments.sol";
88
import { IHorizonStakingBase } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingBase.sol";
99
import { IHorizonStakingMain } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingMain.sol";
10-
import {
11-
IHorizonStakingExtension
12-
} from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingExtension.sol";
10+
import { IHorizonStakingExtension } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingExtension.sol";
1311
import { IHorizonStakingTypes } from "@graphprotocol/interfaces/contracts/horizon/internal/IHorizonStakingTypes.sol";
1412
import { ILinkedList } from "@graphprotocol/interfaces/contracts/horizon/internal/ILinkedList.sol";
1513

@@ -1049,14 +1047,12 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest {
10491047
// calc
10501048
CalcValues_Undelegate memory calcValues;
10511049
calcValues.tokens =
1052-
((beforeValues.pool.tokens - beforeValues.pool.tokensThawing) * shares) /
1053-
beforeValues.pool.shares;
1050+
((beforeValues.pool.tokens - beforeValues.pool.tokensThawing) * shares) / beforeValues.pool.shares;
10541051
calcValues.thawingShares = beforeValues.pool.tokensThawing == 0
10551052
? calcValues.tokens
10561053
: (beforeValues.pool.sharesThawing * calcValues.tokens) / beforeValues.pool.tokensThawing;
10571054
calcValues.thawingUntil =
1058-
staking.getProvision(serviceProvider, verifier).thawingPeriod +
1059-
uint64(block.timestamp);
1055+
staking.getProvision(serviceProvider, verifier).thawingPeriod + uint64(block.timestamp);
10601056
calcValues.thawRequestId = keccak256(
10611057
abi.encodePacked(serviceProvider, verifier, beneficiary, beforeValues.thawRequestList.nonce)
10621058
);
@@ -1675,8 +1671,7 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest {
16751671
indexerRewards: 0
16761672
});
16771673
calcValues.indexerRewards =
1678-
ALLOCATIONS_REWARD_CUT -
1679-
(beforeValues.pool.tokens > 0 ? calcValues.delegatorRewards : 0);
1674+
ALLOCATIONS_REWARD_CUT - (beforeValues.pool.tokens > 0 ? calcValues.delegatorRewards : 0);
16801675

16811676
// closeAllocation
16821677
vm.expectEmit(address(staking));
@@ -1850,8 +1845,7 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest {
18501845
calcValues.delegationFeeCut = 0;
18511846
if (beforeValues.pool.tokens > 0) {
18521847
calcValues.delegationFeeCut =
1853-
calcValues.payment -
1854-
calcValues.payment.mulPPM(beforeValues.pool.__DEPRECATED_queryFeeCut);
1848+
calcValues.payment - calcValues.payment.mulPPM(beforeValues.pool.__DEPRECATED_queryFeeCut);
18551849
calcValues.payment -= calcValues.delegationFeeCut;
18561850
}
18571851

0 commit comments

Comments
 (0)