You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am on 11:18:17 of this tutorial and I am working on this unit test section. I just want to be sure I am understanding this before changing the code from the lesson. I am using ethersV6 and using TypeScript< any >. When I am calling the priceFeed() method from FundMe.sol, I am getting nothing in my response. But if I access FundMe like fundMe.priceFeed._contracts.target Is this the same thing as fundMe.priceFeed()?
await ethers.getContract("FundMe", deployer) seems to not be working for me using different versions, so I was trying to modify the test while attempting to stay true to what is being taught. Also,mockV3Aggregator.address no longer works either, that is why I am using .target. If I wanted to use address, I would have to use mockV3Aggregator.runner.address
When I try running the test with fundMe.priceFeed(), I get this failing test.
This is how I have the code written. Also, in the beforeEach, on my line 11, Patrick uses await ethers.getContract("FundMe", deployer) but that method no longer seems to work, and I am kinda assuming/thinking that the updated method is await ethers.getContractAt("FundMe", deployer). Here is my failing test file for reference.
And here is how I have the test written now. This test passes, but am I making a proper change that still follows what the video is teaching? I was looking at the object that printed from fundMe in console log and think that this is the correct comparison, but I am not 100% sure about that. The addresses are from deployer. Why wouldn't await fundMe.priceFeed() give me an address to compare?
TLDR: Can I replace await fundMe.priceFeed() with fundMe.priceFeed._contracts.target?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Thank you for taking a look at my question.
TLDR at bottom of message**
I am on 11:18:17 of this tutorial and I am working on this unit test section. I just want to be sure I am understanding this before changing the code from the lesson. I am using ethersV6 and using TypeScript< any >. When I am calling the priceFeed() method from FundMe.sol, I am getting nothing in my response. But if I access FundMe like
fundMe.priceFeed._contracts.target
Is this the same thing asfundMe.priceFeed()
?await ethers.getContract("FundMe", deployer)
seems to not be working for me using different versions, so I was trying to modify the test while attempting to stay true to what is being taught. Also,mockV3Aggregator.address
no longer works either, that is why I am using.target
. If I wanted to use address, I would have to usemockV3Aggregator.runner.address
When I try running the test with

fundMe.priceFeed()
, I get this failing test.This is how I have the code written. Also, in the beforeEach, on my line 11, Patrick uses

await ethers.getContract("FundMe", deployer)
but that method no longer seems to work, and I am kinda assuming/thinking that the updated method isawait ethers.getContractAt("FundMe", deployer)
. Here is my failing test file for reference.And here is how I have the test written now. This test passes, but am I making a proper change that still follows what the video is teaching? I was looking at the object that printed from

fundMe
in console log and think that this is the correct comparison, but I am not 100% sure about that. The addresses are from deployer. Why wouldn'tawait fundMe.priceFeed()
give me an address to compare?TLDR: Can I replace
await fundMe.priceFeed()
withfundMe.priceFeed._contracts.target
?Beta Was this translation helpful? Give feedback.
All reactions