smartcontractkit / hardhat-starter-kit

A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
MIT License
1.22k stars 492 forks source link

Full APIConsumer unit test mocking MockOracle request fulfillment #70

Closed rogargon closed 2 years ago

rogargon commented 2 years ago

The current version of the APIConsumer unit test just checks that the request is made. Added a new test that mocks oracle request fulfillment so the full process can be tested. This way, using a local network, it can be tested how the oracle response is processed.

PatrickAlphaC commented 2 years ago

This looks awesome! @andrejrakic, curious if this is something you can look at? Ideally we'd add the mocking VRF response too.

rogargon commented 2 years ago

As part of our Chainlink Hackathon submission, we also developed a task to simulate an oracle in the local test network. This helped during fronted development too. More details: https://github.com/rogargon/YTVideoNFTknz/blob/main/tasks/mockoracle.js

andrejrakic commented 2 years ago

Hey @rogargon thanks for the PR, nice work! One thing, would you be kind to resolve a conflict on your local branch before the review process? Thanks in advance

rogargon commented 2 years ago

Thanks! Conflict resolved