this worked! Thank you! Unfortunatly this now throws off my unit test. It wont even get past the very first test.
When I run hh test, I now get this error:
Raffle Unit Tests
constructor
1) "before each" hook for "initializes the raffle correctly"
0 passing (1s)
1 failing
1) Raffle Unit Tests
"before each" hook for "initializes the raffle correctly":
ERROR processing /Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/deploy/01-deploy-raffle.js:
Error: invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.6.2)
at Logger.makeError (/Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:261:28)
at Logger.throwError (/Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:273:20)
at Logger.throwArgumentError (/Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:277:21)
at Function.BigNumber.from (/Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/bignumber/src.ts/bignumber.ts:289:23)
at NumberCoder.encode (/Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/number.ts:25:27)
at /Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:71:19
at Array.forEach (<anonymous>)
at pack (/Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:54:12)
at TupleCoder.encode (/Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:54:20)
at AbiCoder.encode (/Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/abi-coder.ts:111:15)
Error: ERROR processing /Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/deploy/01-deploy-raffle.js:
Error: invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.6.2)
at Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:261:28)
at Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:273:20)
at Logger.throwArgumentError (node_modules/@ethersproject/logger/src.ts/index.ts:277:21)
at Function.BigNumber.from (node_modules/@ethersproject/bignumber/src.ts/bignumber.ts:289:23)
at NumberCoder.encode (node_modules/@ethersproject/abi/src.ts/coders/number.ts:25:27)
at /Users/carson/repos/freeCodeCamp_lessons/full-blockchain-solidity-course-js/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:71:19
at Array.forEach (<anonymous>)
at pack (node_modules/@ethersproject/abi/src.ts/coders/array.ts:54:12)
at TupleCoder.encode (node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:54:20)
at AbiCoder.encode (node_modules/@ethersproject/abi/src.ts/abi-coder.ts:111:15)
at DeploymentsManager.executeDeployScripts (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
at DeploymentsManager.runDeploy (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1052:5)
at Object.fixture (node_modules/hardhat-deploy/src/DeploymentsManager.ts:315:9)
at Context.<anonymous> (test/unit/Raffle.test.js:13:15)
``
I was getting this error before and the issue was my arangement of arguments. I changed their order back to what worked before and this made both the staging test and unit test not work.
Here is my 1-deploy-raffle.js file for reference
this worked! Thank you! Unfortunatly this now throws off my unit test. It wont even get past the very first test.
When I run hh test, I now get this error:
const { getNamedAccounts, deployments, network, run } = require("hardhat") const { networkConfig, developmentChains, VERIFICATION_BLOCK_CONFIRMATIONS, } = require("../helper-hardhat-config") const { verify } = require("../utils/verify")
const FUND_AMOUNT = "1000000000000000000000"
module.exports = async ({ getNamedAccounts, deployments }) => { const { deploy, log } = deployments const { deployer } = await getNamedAccounts() const chainId = network.config.chainId let vrfCoordinatorV2Address, subscriptionId
}
module.exports.tags = ["all", "raffle"] `` here is my repo as well:
https://github.com/cah311/hardhat-lottery-fcc
Originally posted by @cah311 in https://github.com/smartcontractkit/full-blockchain-solidity-course-js/discussions/1613#discussioncomment-3357036