Skip to content

Commit e00c6f9

Browse files
committed
test: disable interval mining in hardhat network
Signed-off-by: Tomás Migone <[email protected]>
1 parent 149635b commit e00c6f9

File tree

8 files changed

+1
-31
lines changed

8 files changed

+1
-31
lines changed

hardhat.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ const config: HardhatUserConfig = {
157157
accounts: {
158158
mnemonic: DEFAULT_TEST_MNEMONIC,
159159
},
160-
mining: {
161-
auto: false,
162-
interval: 13000,
163-
},
164160
hardfork: 'london',
165161
},
166162
localhost: {

tasks/deployment/deploy.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ task('migrate', 'Migrate contracts')
2626
.setAction(async (taskArgs, hre) => {
2727
const graph = hre.graph(taskArgs)
2828

29-
// Set automine before deploying protocol
30-
// Not all local nodes support it though
31-
if (isGraphChainL1Localhost(graph.chainId)) {
32-
try {
33-
await helpers.setAutoMine(true)
34-
} catch (error) {
35-
console.error('Could not set automine to true, node might not support it')
36-
}
37-
}
38-
3929
await deployGraphNetwork(
4030
taskArgs.addressBook,
4131
taskArgs.graphConfig,

test/epochs.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ describe('EpochManager', () => {
1818
const epochLength: BigNumber = toBN('3')
1919

2020
before(async function () {
21-
await helpers.setIntervalMining(0)
22-
await helpers.setAutoMine(true)
2321
;[me, governor] = await graph.getTestAccounts()
2422
;({ governor } = await graph.getNamedAccounts())
2523
})

test/governance/governed.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ describe('Governed', () => {
1919
beforeEach(async function () {
2020
;[me, governor] = await graph.getTestAccounts()
2121

22-
await helpers.setAutoMine(true)
23-
await helpers.setIntervalMining(0)
24-
2522
const factory = await ethers.getContractFactory('GovernedMock')
2623
governed = (await factory.connect(governor).deploy()) as unknown as Governed
2724
})

test/l2/l2GraphToken.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ describe('L2GraphToken', () => {
2424
let grt: L2GraphToken
2525

2626
before(async function () {
27-
await helpers.setIntervalMining(0)
28-
await helpers.setAutoMine(true)
2927
;[mockL1GRT, mockL2Gateway, user] = await graph.getTestAccounts()
3028
;({ governor } = await graph.getNamedAccounts())
3129
fixture = new NetworkFixture(graph.provider)

test/lib/fixtures.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ import { LibExponential } from '../../build/types/LibExponential'
2525
import {
2626
DeployType,
2727
GraphNetworkContracts,
28-
acceptOwnership,
2928
deploy,
3029
deployGraphNetwork,
3130
helpers,
32-
isGraphL1ChainId,
3331
loadGraphNetworkContracts,
34-
toBN,
35-
toGRT,
3632
} from '@graphprotocol/sdk'
3733
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
3834

@@ -78,6 +74,7 @@ export class NetworkFixture {
7874
constructor(public provider: providers.Provider) {}
7975

8076
async load(deployer: SignerWithAddress, l2Deploy?: boolean): Promise<GraphNetworkContracts> {
77+
// Ensure we are auto mining
8178
await helpers.setIntervalMining(0)
8279
await helpers.setAutoMine(true)
8380

@@ -206,8 +203,6 @@ export class NetworkFixture {
206203

207204
async setUp(): Promise<void> {
208205
this.lastSnapshot = await helpers.takeSnapshot()
209-
await helpers.setIntervalMining(0)
210-
await helpers.setAutoMine(true)
211206
}
212207

213208
async tearDown(): Promise<void> {

test/lib/graphTokenTests.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ export function grtTests(isL2: boolean): void {
7272
}
7373

7474
before(async function () {
75-
await helpers.setIntervalMining(0)
76-
await helpers.setAutoMine(true)
7775
;({ governor } = await graph.getNamedAccounts())
7876
me = new ethers.Wallet(mePrivateKey, graph.provider)
7977
other = new ethers.Wallet(otherPrivateKey, graph.provider)

test/staking/rebate.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ describe('Staking:rebates', () => {
209209
}
210210

211211
before(async function () {
212-
await helpers.setIntervalMining(0)
213-
await helpers.setAutoMine(true)
214212
;({ governor } = await graph.getNamedAccounts())
215213
fixture = new NetworkFixture(graph.provider)
216214
await fixture.load(governor)

0 commit comments

Comments
 (0)