Replies: 3 comments 4 replies
-
You are awesome!! |
Beta Was this translation helpful? Give feedback.
3 replies
-
Have you come up with a solution to this? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Due to the mac m1 issues, I just gave up at the 7ish hour mark. There were too many links to other contracts that I couldn't make work (it was using chainlink for the random numbers issue) |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
edit: I corrected some mistakes. After finally finishing Lesson 7 I have a better understanding of mocks.
How to mock v0.8 chainlink contracts and interfaces?
I have adapted lesson 7s lottery to use v0.8 versions of the Aggregator, LinkToken, and VRF interfaces. It compiles fine and when using it with remix I am getting the right responses. I would like to implement unit tests it with python now and I am having a hard time understanding what mocks I should use or if there aren't any.
Question: Do I need to mock Interfaces at all? They don't do much besides forcing me to implement certain functions.
Here are the imports from my lottery contract
Looking into my
.brownie
folder I will find the following files:C:\Users\n4n0b1t3\.brownie\packages\smartcontractkit\chainlink-brownie-contracts@0.4.0\contracts\src\v0.8\mocks
Distilled output
The mocks here seem not to do much and are very different from the mocks we are using from chainlink-mix
https://github.com/smartcontractkit/chainlink-mix/tree/main/contracts/test
some digging
If you take a look at the chainlink-mix example code you can see that v0.8 is implemented as well:
https://github.com/smartcontractkit/chainlink-mix/blob/main/contracts/VRFConsumerV2.sol
Is building my own mocks worth the trouble?
So I have three options here:
As you might guess, I am in favor of option 3, can you help me with this?
Beta Was this translation helpful? Give feedback.
All reactions