Skip to content

Commit

Permalink
Merge pull request #202 from smartcontractkit/fix/ignore-private-key
Browse files Browse the repository at this point in the history
PRIVATE_KEY not needed for simulation
  • Loading branch information
aelmanaa authored Jan 9, 2024
2 parents b5afd4a + a1e1535 commit 6e994a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ const DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS = 2
const npmCommand = process.env.npm_lifecycle_event
const isTestEnvironment = npmCommand == "test" || npmCommand == "test:unit"

const isSimulation = process.argv.length === 3 && process.argv[2] === "functions-simulate-script" ? true : false

// Set EVM private keys (required)
const PRIVATE_KEY = process.env.PRIVATE_KEY

// TODO @dev - set this to run the accept.js task.
const SECOND_PRIVATE_KEY = process.env.SECOND_PRIVATE_KEY

if (!isTestEnvironment && !PRIVATE_KEY) {
if (!isTestEnvironment && !isSimulation && !PRIVATE_KEY) {
throw Error("Set the PRIVATE_KEY environment variable with your EVM wallet private key")
}

Expand Down

0 comments on commit 6e994a5

Please sign in to comment.