contract MockChainlinkAggregator is AggregatorV3Interface {
  uint256 private _latestPrice;
  uint256 private _updatedAt;
  string public override description;
  uint256 public override version = 3;

  uint8 public override decimals;

  constructor(
    uint8 _decimals,
    uint256 _price,
    string memory _description
  ) public {
    decimals = _decimals;
    _latestPrice = _price;
    description = _description;
  }

  function setLatestPrice(uint256 price) public {
    _latestPrice = price;
  }

  function setUpdatedAt(uint256 updatedAt) public {
    _updatedAt = updatedAt;
  }

  /**
   * @notice get data about a round. Consumers are encouraged to check
   * that they're receiving fresh data by inspecting the updatedAt and
   * answeredInRound return values.
   * Note that different underlying implementations of AggregatorV3Interface
   * have slightly different semantics for some of the return values. Consumers
   * should determine what implementations they expect to receive
   * data from and validate that they can properly handle return data from all
   * of them.
   * @param _roundId the requested round ID as presented through the proxy, this
   * is made up of the aggregator's round ID with the phase ID encoded in the
   * two highest order bytes
   * @return roundId is the round ID from the aggregator for which the data was
   * retrieved combined with an phase to ensure that round IDs get larger as
   * time moves forward.
   * @return answer is the answer for the given round
   * @return startedAt is the timestamp when the round was started.
   * (Only some AggregatorV3Interface implementations return meaningful values)
   * @return updatedAt is the timestamp when the round last was updated (i.e.
   * answer was last computed)
   * @return answeredInRound is the round ID of the round in which the answer
   * was computed.
   * (Only some AggregatorV3Interface implementations return meaningful values)
   * @dev Note that answer and updatedAt may change between queries.
   */
  function getRoundData(uint80 _roundId)
    public
    view
    override
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    )
  {
    roundId = uint80(_roundId);
    answer = int256(_latestPrice);
    startedAt = uint256(1597422127);
    updatedAt = uint256(1597695228);
    answeredInRound = uint80(_roundId);
  }

  /**
   * @notice get data about the latest round. Consumers are encouraged to check
   * that they're receiving fresh data by inspecting the updatedAt and
   * answeredInRound return values.
   * Note that different underlying implementations of AggregatorV3Interface
   * have slightly different semantics for some of the return values. Consumers
   * should determine what implementations they expect to receive
   * data from and validate that they can properly handle return data from all
   * of them.
   * @return roundId is the round ID from the aggregator for which the data was
   * retrieved combined with an phase to ensure that round IDs get larger as
   * time moves forward.
   * @return answer is the answer for the given round
   * @return startedAt is the timestamp when the round was started.
   * (Only some AggregatorV3Interface implementations return meaningful values)
   * @return updatedAt is the timestamp when the round last was updated (i.e.
   * answer was last computed)
   * @return answeredInRound is the round ID of the round in which the answer
   * was computed.
   * (Only some AggregatorV3Interface implementations return meaningful values)
   * @dev Note that answer and updatedAt may change between queries.
   */
  function latestRoundData()
    public
    view
    override
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    )
  {
    uint256 latestRound = 101;
    roundId = uint80(latestRound);
    answer = int256(_latestPrice);
    startedAt = uint256(1597422127);
    updatedAt = _updatedAt;
    answeredInRound = uint80(latestRound);
  }
}
function getRoundData(uint80 _roundId)
  public
  view
  override
  returns (
    uint80 roundId,
    int256 answer,
    uint256 startedAt,
    uint256 updatedAt,
    uint80 answeredInRound
  )
{
  roundId = uint80(_roundId);
  answer = int256(_latestPrice);
  startedAt = uint256(1597422127);
  updatedAt = uint256(1597695228);
  answeredInRound = uint80(_roundId);
}

/**
 * @notice get data about a round. Consumers are encouraged to check
 * that they're receiving fresh data by inspecting the updatedAt and
 * answeredInRound return values.
 * Note that different underlying implementations of AggregatorV3Interface
 * have slightly different semantics for some of the return values. Consumers
 * should determine what implementations they expect to receive
 * data from and validate that they can properly handle return data from all
 * of them.
 * @param _roundId the requested round ID as presented through the proxy, this
 * is made up of the aggregator's round ID with the phase ID encoded in the
 * two highest order bytes
 * @return roundId is the round ID from the aggregator for which the data was
 * retrieved combined with an phase to ensure that round IDs get larger as
 * time moves forward.
 * @return answer is the answer for the given round
 * @return startedAt is the timestamp when the round was started.
 * (Only some AggregatorV3Interface implementations return meaningful values)
 * @return updatedAt is the timestamp when the round last was updated (i.e.
 * answer was last computed)
 * @return answeredInRound is the round ID of the round in which the answer
 * was computed.
 * (Only some AggregatorV3Interface implementations return meaningful values)
 * @dev Note that answer and updatedAt may change between queries.
 */