Closed Rampalamp closed 1 year ago
I think I found the issue... After increasing the gasBlockLimit substantially I received the following error: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
This led me to believe the for loop in the withdraw function was not working as intended. I checked and noticed one difference.
BAD LOOP CAUSING ERROR
for (
uint256 funderIndex = 0;
funderIndex < funders.length;
funderIndex = funderIndex++
)
GOOD LOOP
for (
uint256 funderIndex = 0;
funderIndex < funders.length;
funderIndex++
)
So it looks like the funderIndex = funderIndex++ increment operation was not working as intended. I think in the initial Remix FundMe section of the video tutorial, that the code was written in the incorrect format, but it looks like the code has been fixed in the repos.
Just confirmed, at the 4:39:03 time stamp of the Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course
Hello, I am using the default hardhat network and when running my unit tests for withdraw I am getting the following error : TransactionExecutionError: Transaction ran out of gas
Here is the test - it fails on the line that reads : const transactionResponse = await fundMe.withdraw();
Here is the withdraw function
I have tried upping the blockGasLimit in the hardhat config for the hardhat network, but this did not seem to help. I have not ran into this Transaction ran out of gas error when using the default hardhat until now. Besides perhaps some variable name differences, I have been following the youtube tutorial exactly.
Attempted to google variations of "hardhat test transaction ran out of gas" but did not receive many good hits and scanned older issues in this repot. Any help is appreciated, thanks in advance.