smartcontractkit / chainlink-brownie-contracts

A repository for automatically using the latest chainlink repo from the core chainlink repo.
293 stars 63 forks source link

VRFCoodinator Mock for new 2_5 version #28

Open CaiqueRibeiro opened 4 months ago

CaiqueRibeiro commented 4 months ago

I'm doing Cyfrin lessons for "Smart Contract Lottery", but I was having trouble using VRFCoordinatorV2Mock. It already exists in official chainlink repository, but I could not find it in this one. Because of it I was not able to do tests with foundry _(I'm using de VRF 25 in my contract file).

I made myself some adjusts in src/v0.8/dev/vrf/SubscriptionAPI.sol and created a new VRFCoordinatorV2_5Mock.sol in same repository of VRFCoordinatorV2Mock.sol and could make it work for tests.

I don't know if it is going to be release in a newer version of this repo, but if not, I can send a PR here to verify if my changes to SubscriptionAPI.sol won't break anything.

RamanSB commented 4 months ago

Hi @CaiqueRibeiro I've raised this PR, feel free to copy and paste it in and let me know how you get on, I've used it to complete the Smart Contract Lottery lesson.