From 48a4c569e35f891df36290f908148d27be65c076 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Tue, 21 Sep 2021 14:44:18 -0600 Subject: [PATCH] Improve handling of PRIVATE_KEY env var Now matches what we were already doing in the advanced JS project. Addresses review comment https://github.com/nomiclabs/hardhat/pull/1770#discussion_r711308973 --- .../hardhat-core/sample-projects/advanced-ts/hardhat.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hardhat-core/sample-projects/advanced-ts/hardhat.config.ts b/packages/hardhat-core/sample-projects/advanced-ts/hardhat.config.ts index 2752d7fc1e..0f1c6e17ad 100644 --- a/packages/hardhat-core/sample-projects/advanced-ts/hardhat.config.ts +++ b/packages/hardhat-core/sample-projects/advanced-ts/hardhat.config.ts @@ -27,7 +27,8 @@ const config: HardhatUserConfig = { networks: { ropsten: { url: process.env.ROPSTEN_URL || "", - accounts: [process.env.PRIVATE_KEY || `0x${"0".repeat(40)}`], + accounts: + process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, }, gasReporter: {