|
1 | 1 | import { KNOWN_NETWORKS } from "@ganache/ethereum-options"; |
2 | 2 | import getProvider from "../helpers/getProvider"; |
| 3 | +import skipIfNoInfuraKey from "../helpers/skipIfNoInfuraKey"; |
3 | 4 | import http from "http"; |
4 | 5 | import ganache from "../../../../../packages/core"; |
5 | 6 | import assert from "assert"; |
@@ -1047,9 +1048,7 @@ describe("forking", () => { |
1047 | 1048 | let remoteProvider: EthereumProvider; |
1048 | 1049 | let remoteAccounts: string[]; |
1049 | 1050 |
|
1050 | | - before("skip if we don't have the INFURA_KEY", function () { |
1051 | | - if (!process.env.INFURA_KEY) this.skip(); |
1052 | | - }); |
| 1051 | + skipIfNoInfuraKey(); |
1053 | 1052 |
|
1054 | 1053 | before("configure mainnet", async function () { |
1055 | 1054 | // we fork from mainnet, but configure our fork such that it looks like |
@@ -1171,9 +1170,7 @@ describe("forking", () => { |
1171 | 1170 | let provider: EthereumProvider; |
1172 | 1171 | const URL = "https://mainnet.infura.io/v3/" + process.env.INFURA_KEY; |
1173 | 1172 |
|
1174 | | - before("skip if we don't have the INFURA_KEY", function () { |
1175 | | - if (!process.env.INFURA_KEY) this.skip(); |
1176 | | - }); |
| 1173 | + skipIfNoInfuraKey(); |
1177 | 1174 |
|
1178 | 1175 | before("configure provider", async () => { |
1179 | 1176 | provider = await getProvider({ |
@@ -1247,11 +1244,8 @@ describe("forking", function () { |
1247 | 1244 | } |
1248 | 1245 | }; |
1249 | 1246 | let localProvider: EthereumProvider; |
1250 | | - before("check conditions", function () { |
1251 | | - if (!process.env.INFURA_KEY) { |
1252 | | - this.skip(); |
1253 | | - } |
1254 | | - }); |
| 1247 | + |
| 1248 | + skipIfNoInfuraKey(); |
1255 | 1249 |
|
1256 | 1250 | KNOWN_NETWORKS.forEach(network => { |
1257 | 1251 | describe(network, () => { |
@@ -1383,12 +1377,12 @@ describe("forking", function () { |
1383 | 1377 | validatorIndex: "0x3a995" |
1384 | 1378 | } |
1385 | 1379 | ]; |
1386 | | - before("skip if we don't have the INFURA_KEY", function () { |
1387 | | - // this test uses the `network: "goerli"` option, which requires an |
1388 | | - // infura key; when run our tests it must be provided as an environment |
1389 | | - // variable. |
1390 | | - if (!process.env.INFURA_KEY) this.skip(); |
1391 | | - }); |
| 1380 | + |
| 1381 | + // this test uses the `network: "goerli"` option, which requires an |
| 1382 | + // infura key; when run our tests it must be provided as an environment |
| 1383 | + // variable. |
| 1384 | + skipIfNoInfuraKey(); |
| 1385 | + |
1392 | 1386 | describe("shanghai", () => { |
1393 | 1387 | let provider: EthereumProvider; |
1394 | 1388 | const blockNumber = 8765432; |
|
0 commit comments