From 9db29f2ededee70056cb213d684a1d6c9c73d4fc Mon Sep 17 00:00:00 2001 From: SnowShield Date: Fri, 8 Apr 2022 17:43:35 +0300 Subject: [PATCH] Fix compile without FORKNET_RPC_URL env --- hardhat.config.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hardhat.config.js b/hardhat.config.js index e1b7bd1..fd26f05 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -69,12 +69,16 @@ module.exports = { ? [process.env.PRIVATE_KEY] : { mnemonic: 'test test test test test junk' }, }, - forknet: { - url: process.env.FORKNET_RPC_URL, - accounts: process.env.PRIVATE_KEY - ? [process.env.PRIVATE_KEY] - : { mnemonic: 'test test test test test junk' }, - }, + ...(typeof process.env.FORKNET_RPC_URL === 'string' + ? { + forknet: { + url: process.env.FORKNET_RPC_URL, + accounts: process.env.PRIVATE_KEY + ? [process.env.PRIVATE_KEY] + : { mnemonic: 'test test test test test junk' }, + }, + } + : {}), }, mocha: { timeout: 9999999999 }, spdxLicenseIdentifier: {