Function: getOraclePriceWithFreshness(IQiToken qiToken, bool isEdge, uint256 stalenessThreshold)
This function gets a price from an oracle and checks if it is fresh.
Inputs
qiTokenControl: Fully controlled by the caller.
Constraints: None.
Impact: A
qiTokento get the price of.
isEdgeControl: Fully controlled by the caller.
Constraints: None.
Impact: A boolean to check if the price should be retrieved from the Edge oracle.
stalenessThresholdControl: Fully controlled by the caller.
Constraints: None.
Impact: A staleness threshold to check if the price is stale.
Branches and code coverage
Intended branches
Check if the price is stale.
Get the price from the Edge oracle.
Get the price from the Chainlink oracle.
Return the price and whether it is stale.
Negative behavior
Revert if the price is zero.