vfurci200
vfurci200

Reputation: 23

How are chainlink requests processed when forking mainnet in Brownie?

From the brownie chainlink-mix, why does the PriceFeed works fine on mainnet-fork while the ApiConsumer does not fulfill the request on the same network? Are prices cached on the Aggregator?

Upvotes: 2

Views: 249

Answers (1)

Harry Papacharissiou
Harry Papacharissiou

Reputation: 856

When you fork the mainnet, it literally forks the blockchchain state at that point in time. So when you query the Price Feed Aggregator contract, you get the price at the time of forking.

However because there are no Chainlink oracles connected to your forked chain, there's no way to do a real API or VRF request...and the latest price data in Price Feed contracts won't update either.

Check out the tests to see how mocks are used for local environments where there is no connectivity to Chainlink nodes

Upvotes: 2

Related Questions