Skip to content

Commit 0247adb

Browse files
committed
chore: linting and other minor issues
Signed-off-by: Tomás Migone <[email protected]>
1 parent ea14f20 commit 0247adb

File tree

19 files changed

+33
-26
lines changed

19 files changed

+33
-26
lines changed

packages/hardhat-graph-protocol/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import fs from 'fs'
22
import path from 'path'
33

4-
import { GraphPluginError } from './error'
54
import { logDebug, logError } from './logger'
5+
import { GraphPluginError } from './error'
66

77
import type { GraphDeploymentName } from '@graphprotocol/toolshed/deployments'
88
import type { GraphRuntimeEnvironmentOptions } from './types'

packages/horizon/contracts/interfaces/IGraphPayments.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ interface IGraphPayments {
6666
/**
6767
* @notice Collects funds from a payer.
6868
* It will pay cuts to all relevant parties and forward the rest to the receiver destination address. If the
69-
* destination address is zero the funds are automatically staked to the receiver. Note that the receiver
69+
* destination address is zero the funds are automatically staked to the receiver. Note that the receiver
7070
* destination address can be set to the receiver address to collect funds on the receiver without re-staking.
7171
*
7272
* Note that the collected amount can be zero.

packages/horizon/contracts/mocks/imports.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ interface IL2CurationToolshed is IL2Curation {
2727

2828
interface IEpochManagerToolshed is IEpochManager {
2929
function epochLength() external view returns (uint256);
30-
}
30+
}

packages/horizon/tasks/deploy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ task('deploy:protocol', 'Deploy a new version of the Graph Protocol Horizon cont
4141

4242
// Save the addresses to the address book
4343
console.log('\n========== 📖 Updating address book ==========')
44+
// @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here
4445
saveToAddressBook(deployment, graph.horizon.addressBook)
4546
console.log(`Address book at ${graph.horizon.addressBook.file} updated!`)
4647

@@ -113,6 +114,7 @@ task('deploy:migrate', 'Upgrade an existing version of the Graph Protocol v1 to
113114

114115
// Update address book
115116
console.log('\n========== 📖 Updating address book ==========')
117+
// @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here
116118
saveToAddressBook(deployment, graph.horizon.addressBook)
117119
console.log(`Address book at ${graph.horizon.addressBook.file} updated!`)
118120

packages/horizon/test/deployment/Controller.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import hre from 'hardhat'
22

33
import { expect } from 'chai'
4-
import { toUtf8Bytes } from 'ethers'
54
import { testIf } from './lib/testIf'
5+
import { toUtf8Bytes } from 'ethers'
66

77
const graph = hre.graph()
88
const addressBook = graph.horizon.addressBook

packages/horizon/test/deployment/lib/GraphProxy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { assert, expect } from 'chai'
44
import { AddressBookEntry } from '@graphprotocol/toolshed/deployments'
55
import { zeroPadValue } from 'ethers'
66

7-
export function graphProxyTests(contractName: string, addressBookEntry: AddressBookEntry, proxyAdmin: string, upgraded: boolean = false): void {
7+
export function graphProxyTests(contractName: string, addressBookEntry: AddressBookEntry, proxyAdmin: string, upgraded = false): void {
88
const testIf = () => (upgraded ? it : it.skip)
99

1010
describe(`${contractName}: GraphProxy`, function () {

packages/horizon/test/integration/after-transition-period/upgrade.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('Upgrading contracts', () => {
5454
it('GraphPayments should be upgradeable by the governor', async () => {
5555
const entry = graph.horizon.addressBook.getEntry('GraphPayments')
5656
const proxyAdmin = entry.proxyAdmin!
57-
const proxy = entry.address!
57+
const proxy = entry.address
5858

5959
// Upgrade the contract to a different implementation
6060
// the implementation we use is the GraphTallyCollector, this is obviously absurd but we just need an address with code on it
@@ -69,7 +69,7 @@ describe('Upgrading contracts', () => {
6969
it('PaymentsEscrow should be upgradeable by the governor', async () => {
7070
const entry = graph.horizon.addressBook.getEntry('PaymentsEscrow')
7171
const proxyAdmin = entry.proxyAdmin!
72-
const proxy = entry.address!
72+
const proxy = entry.address
7373

7474
// Upgrade the contract to a different implementation
7575
// the implementation we use is the GraphTallyCollector, this is obviously absurd but we just need an address with code on it

packages/horizon/test/integration/during-transition-period/multicall.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import hre from 'hardhat'
22

3+
import { ONE_MILLION, PaymentTypes } from '@graphprotocol/toolshed'
34
import { ethers } from 'hardhat'
45
import { expect } from 'chai'
5-
import { ONE_MILLION, PaymentTypes } from '@graphprotocol/toolshed'
66
import { setGRTBalance } from '@graphprotocol/toolshed/hardhat'
77

88
import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
contracts/mocks/*

packages/subgraph-service/contracts/mocks/imports.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ interface IL2CurationToolshed is IL2Curation {
1515
}
1616

1717
interface IServiceRegistryToolshed is IServiceRegistry {
18-
function services(address _indexer) external view returns (IServiceRegistry.IndexerService memory);
19-
}
18+
function services(address indexer) external view returns (IServiceRegistry.IndexerService memory);
19+
}

packages/subgraph-service/natspec-smells.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
/** @type {import('@defi-wonderland/natspec-smells').Config} */
66
module.exports = {
77
include: 'contracts/**/*.sol',
8-
exclude: 'test/**/*.sol',
8+
exclude: ['test/**/*.sol', 'contracts/mocks/**/*.sol'],
99
constructorNatspec: true,
1010
}

packages/subgraph-service/scripts/ops/protocol-activity.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ async function main() {
165165
const curate = Math.random() < 0.5
166166
if (curate) {
167167
await GraphToken.connect(signer).approve(Curation.target, 12345n)
168+
// @ts-expect-error - TODO: Fix this?
168169
await Curation.connect(signer).mint(subgraphDeploymentId, 12345n, 0)
169170
}
170171
}

packages/subgraph-service/tasks/deploy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ task('deploy:protocol', 'Deploy a new version of the Graph Protocol Horizon cont
8080

8181
// Save the addresses to the address book
8282
console.log('\n========== 📖 Updating address book ==========')
83+
// @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here
8384
saveToAddressBook(horizonDeployment, graph.horizon.addressBook)
85+
// @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here
8486
saveToAddressBook(proxiesDeployment, graph.subgraphService.addressBook)
87+
// @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here
8588
saveToAddressBook(subgraphServiceDeployment, graph.subgraphService.addressBook)
8689
console.log(`Address book at ${graph.horizon.addressBook.file} updated!`)
8790
console.log(`Address book at ${graph.subgraphService.addressBook.file} updated!`)
@@ -146,6 +149,7 @@ task('deploy:migrate', 'Deploy the Subgraph Service on an existing Horizon deplo
146149

147150
// Update address book
148151
console.log('\n========== 📖 Updating address book ==========')
152+
// @ts-expect-error - @graphprotocol/toolshed/hardhat exports ts files so types mismatch here
149153
saveToAddressBook(deployment, graph.subgraphService.addressBook)
150154
console.log(`Address book at ${graph.subgraphService.addressBook.file} updated!`)
151155

packages/subgraph-service/test/integration/after-transition-period/upgrade.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('Upgrading contracts', () => {
5454
it('subgraph service should be upgradeable by the governor', async () => {
5555
const entry = graph.subgraphService.addressBook.getEntry('SubgraphService')
5656
const proxyAdmin = entry.proxyAdmin!
57-
const proxy = entry.address!
57+
const proxy = entry.address
5858

5959
// Upgrade the contract to a different implementation
6060
// the implementation we use is the GraphTallyCollector, this is obviously absurd but we just need an address with code on it
@@ -69,7 +69,7 @@ describe('Upgrading contracts', () => {
6969
it('dispute manager should be upgradeable by the governor', async () => {
7070
const entry = graph.subgraphService.addressBook.getEntry('DisputeManager')
7171
const proxyAdmin = entry.proxyAdmin!
72-
const proxy = entry.address!
72+
const proxy = entry.address
7373

7474
// Upgrade the contract to a different implementation
7575
// the implementation we use is the GraphTallyCollector, this is obviously absurd but we just need an address with code on it

packages/subgraph-service/test/integration/during-transition-period/dispute-manager.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ethers } from 'hardhat'
22
import { expect } from 'chai'
33
import hre from 'hardhat'
4-
import { EventLog } from 'ethers'
54

65
import { DisputeManager, IGraphToken, SubgraphService } from '../../../typechain-types'
76
import { generateLegacyIndexingDisputeId, generateLegacyTypeDisputeId } from '@graphprotocol/toolshed'
@@ -98,7 +97,7 @@ describe('Dispute Manager', () => {
9897
allocationId,
9998
fisherman.address,
10099
tokensToSlash,
101-
tokensToReward
100+
tokensToReward,
102101
)
103102

104103
// Get dispute ID from event
@@ -130,8 +129,8 @@ describe('Dispute Manager', () => {
130129
ethers.Wallet.createRandom().address,
131130
fisherman.address,
132131
tokensToSlash,
133-
tokensToReward
134-
)
132+
tokensToReward,
133+
),
135134
).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerIndexerNotFound')
136135
})
137136
})
@@ -146,8 +145,8 @@ describe('Dispute Manager', () => {
146145
allocationId,
147146
fisherman.address,
148147
tokensToSlash,
149-
tokensToReward
150-
)
148+
tokensToReward,
149+
),
151150
).to.be.revertedWithCustomError(disputeManager, 'DisputeManagerNotArbitrator')
152151
})
153152
})

packages/subgraph-service/test/integration/during-transition-period/legacy-dispute-manager.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe('Legacy Dispute Manager', () => {
135135
responseHash,
136136
subgraphDeploymentId,
137137
indexer.address,
138-
fisherman.address
138+
fisherman.address,
139139
)
140140

141141
// Verify dispute was created
@@ -209,14 +209,14 @@ describe('Legacy Dispute Manager', () => {
209209
responseHash1,
210210
subgraphDeploymentId,
211211
indexer.address,
212-
fisherman.address
212+
fisherman.address,
213213
)
214214
const disputeId2 = generateLegacyQueryDisputeId(
215215
queryHash,
216216
responseHash2,
217217
subgraphDeploymentId,
218218
indexer.address,
219-
fisherman.address
219+
fisherman.address,
220220
)
221221

222222
// Verify both disputes were created

packages/subgraph-service/test/unit/disputeManager/disputes/legacy.t.sol

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

44
import "forge-std/Test.sol";
55

6-
import { Attestation } from "../../../../../contracts/libraries/Attestation.sol";
6+
import { Attestation } from "../../../../contracts/libraries/Attestation.sol";
77
import { PPMMath } from "@graphprotocol/horizon/contracts/libraries/PPMMath.sol";
8-
import { IDisputeManager } from "../../../../../contracts/interfaces/IDisputeManager.sol";
8+
import { IDisputeManager } from "../../../../contracts/interfaces/IDisputeManager.sol";
99
import { DisputeManagerTest } from "../DisputeManager.t.sol";
1010

1111
contract DisputeManagerLegacyDisputeTest is DisputeManagerTest {

packages/subgraph-service/test/unit/shared/SubgraphServiceShared.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ abstract contract SubgraphServiceSharedTest is HorizonStakingSharedTest {
186186
staking.delegate(users.indexer, address(subgraphService), tokens, 0);
187187
}
188188

189-
function _calculateStakeSnapshot(uint256 _tokens, uint256 _tokensDelegated) internal view returns (uint256) {
189+
function _calculateStakeSnapshot(uint256 _tokens, uint256 _tokensDelegated) internal pure returns (uint256) {
190190
return _tokens + _tokensDelegated;
191191
}
192192

packages/toolshed/src/core/disputes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export function generateLegacyQueryDisputeId(
2222
export function generateLegacyTypeDisputeId(allocationId: string) {
2323
return ethers.solidityPackedKeccak256(
2424
['address', 'string'],
25-
[allocationId, 'legacy']
25+
[allocationId, 'legacy'],
2626
)
2727
}

0 commit comments

Comments
 (0)