MockV3Aggregator.sol API
Last updated
Last updated
latestAnswer()
Deprecated
latestTimestamp()
Deprecated
latestRound()
Deprecated
getAnswer(uint256 roundId)
Deprecated
getTimestamp(uint256 roundId)
Deprecated
Return the number of digits of precision for the stored answer. Answers are stored in fixed-point format.
Return values:
decimalPlaces
(uint8): The number of digits of precision for the stored answer.
Return a description for this data feed. Usually this is an asset pair for a price feed. In mocks it is hard-coded to: "src/data-feeds/MockV3Aggregator.sol"
.
Return values:
description
(string): The description for this data feed.
Returns the contract version. This is different from the typeAndVersion
for the aggregator. In mocks it is hard-coded to 0
.
Return values:
version
(uint256): The contract version.
Get the full information for a specific aggregator round including the answer and update timestamps. Use this to get the full historical data for a round.
Parameters:
_roundId
(uint80): The round ID.
Return values:
roundId
(uint80): The round ID.
answer
(iint256): The answer for this round.
startedAt
(uint256): Timestamp of when the round started.
updatedAt
(uint256): Timestamp of when the round was updated.
Get the full information for the most recent round including the answer and update timestamps.
Return values:
roundId
(uint80): The round ID.
answer
(iint256): The answer for this round.
startedAt
(uint256): Timestamp of when the round started.
updatedAt
(uint256): Timestamp of when the round was updated.
Sets the new answer that the mock contract will return. Starts the new round automatically. Bumps the roundId
by one. Sets the startedAt
, updatedAt
and answeredInRound
values to block.timestamp
. To update all of these values, use the updateRoundData
function.
Parameters:
_answer
(int256): The new answer for the next round.
Sets new details of the specific round that the mock contract will return.
Parameters:
roundId
(uint80): The round ID.
answer
(iint256): The answer for this round.
startedAt
(uint256): Timestamp of when the round started.
updatedAt
(uint256): Timestamp of when the round was updated.
Returns the address of the current MockOffchainAggregator.sol
contract.
Return values:
aggregator
(address): The address of the current MockOffchainAggregator.sol
contract.
Returns the address of the proposed MockOffchainAggregator.sol
contract. It is address(0)
by default.
Return values:
proposedAggregator
(address): The address of the proposed MockOffchainAggregator.sol
contract.
Proposes the new MockOffchainAggregator.sol
contract. Used as a first step in changing the underlying MockOffchainAggregator.sol
contract. The second step is to call the confirmAggregator()
function.
Parameters:
_aggregator
(address): The address of the MockOffchainAggregator.sol
contract to propose.
Sets the proposed MockOffchainAggregator.sol
contract as the current aggregator
. The proposedAggregator
becomes address(0)
. Reverts if _aggregator
is not equal to proposedAggregator
.
Parameters:
_aggregator
(address): The address of the new MockOffchainAggregator.sol
contract.
answeredInRound
(uint80): Deprecated - Previously used when answers could take multiple rounds to be computed.
answeredInRound
(uint80): Deprecated - Previously used when answers could take multiple rounds to be computed.
answeredInRound
(uint80): Deprecated - Previously used when answers could take multiple rounds to be computed.
Deprecated - Do not use this function.
Deprecated - Do not use this function.
Deprecated - Do not use this function.
Deprecated - Do not use this function.
Deprecated - Do not use this function.