testPriceFeedVersionIsAccurate() is reverting on the local anvil chain #2339
Replies: 2 comments 7 replies
-
Hello @riccardo-csl, Did you figure this out already? |
Beta Was this translation helpful? Give feedback.
7 replies
-
Interesting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello guys, I am at the second section lesson 13 of foundry fundamentals and I am stuck in A pretty annoying problem.
After cerating the Mock file, the helper config file and refactoring everything as shown in the video I tried to run in the sepolia chain and all 3 tests pass with no problems. As i run my Test in local chain created by anvil using only ''' forge test''' it gives me this error:
[10206] FundMeTest::testPriceFeedVersionIsAccurate()
├─ [5099] FundMe::getVersion() [staticcall]
│ ├─ [0] 0x694AA1769357215DE4FAC081bf1f309aDC325306::version() [staticcall]
│ │ └─ ← [Stop]
│ └─ ← [Revert] EvmError: Revert
└─ ← [Revert] EvmError: Revert
I already checked the version in MockV3Aggregator.sol and it is set to 4, I tried to ask chatGPT but I cant find answers.
Here are My codes:
This is the test file
this is the helperConfig
and this is the main fundMe file
By looking at the code and trying to understand the problem, I wonder if the variable s_priceFeed is responsible of this error because it is an AggregatorV3Interface type variable.
Beta Was this translation helpful? Give feedback.
All reactions