Lesson 7 TESTING eth error #1757
-
I have the EXACT same code as patrick but my test is showing error as "You Need to Spend more eth" 2 passing (2s)
3 failing
1) FundMe
fund
Updates the amount funded data structure:
Error: VM Exception while processing transaction: reverted with reason string 'You need to spend more ETH!'
at FundMe.fund (contracts/FundMe.sol:53)
at HardhatNode._mineBlockWithPendingTxs (node_modules\hardhat\src\internal\hardhat-network\provider\node.ts:1773:23)
at HardhatNode.mineBlock (node_modules\hardhat\src\internal\hardhat-network\provider\node.ts:466:16)
at EthModule._sendTransactionAndReturnHash (node_modules\hardhat\src\internal\hardhat-network\provider\modules\eth.ts:1504:18)
at HardhatNetworkProvider.request (node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:118:18)
at EthersProviderWrapper.send (node_modules\@nomiclabs\hardhat-ethers\src\internal\ethers-provider-wrapper.ts:13:20)
2) FundMe
fund
Adds funder to array of funders:
Error: VM Exception while processing transaction: reverted with reason string 'You need to spend more ETH!'
at FundMe.fund (contracts/FundMe.sol:53)
at HardhatNode._mineBlockWithPendingTxs (node_modules\hardhat\src\internal\hardhat-network\provider\node.ts:1773:23)
at HardhatNode.mineBlock (node_modules\hardhat\src\internal\hardhat-network\provider\node.ts:466:16)
at EthModule._sendTransactionAndReturnHash (node_modules\hardhat\src\internal\hardhat-network\provider\modules\eth.ts:1504:18)
at HardhatNetworkProvider.request (node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:118:18)
at EthersProviderWrapper.send (node_modules\@nomiclabs\hardhat-ethers\src\internal\ethers-provider-wrapper.ts:13:20)
3) FundMe
withdraw
"before each" hook for "withdraws ETH from a single funder":
Error: VM Exception while processing transaction: reverted with reason string 'You need to spend more ETH!'
at FundMe.fund (contracts/FundMe.sol:53)
at HardhatNode._mineBlockWithPendingTxs (node_modules\hardhat\src\internal\hardhat-network\provider\node.ts:1773:23)
at HardhatNode.mineBlock (node_modules\hardhat\src\internal\hardhat-network\provider\node.ts:466:16)
at EthModule._sendTransactionAndReturnHash (node_modules\hardhat\src\internal\hardhat-network\provider\modules\eth.ts:1504:18)
at HardhatNetworkProvider.request (node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:118:18)
at EthersProviderWrapper.send (node_modules\@nomiclabs\hardhat-ethers\src\internal\ethers-provider-wrapper.ts:13:20) Please help with this. I think I am getting some maths wrong |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
https://github.com/moayaan1911/hardhat-fundme Here is my repo link, in case u wanna check all the files... |
Beta Was this translation helpful? Give feedback.
-
Hey. As a start, please make sure these two are async functions: They should be: I'm guessing since the |
Beta Was this translation helpful? Give feedback.
-
@moayaan1911 As you said you have the exact same code as Patrick, so when Patrick recorded the video ETH price was $4000 now it is $1800, so make sure the value is according to current price. If you face problems to solve the issue the push the code to repo and leave link here. |
Beta Was this translation helpful? Give feedback.
@moayaan1911 As you said you have the exact same code as Patrick, so when Patrick recorded the video ETH price was $4000 now it is $1800, so make sure the value is according to current price.
If you face problems to solve the issue the push the code to repo and leave link here.