From a12a19d966c110ff98890d05f106d51e111dc0e2 Mon Sep 17 00:00:00 2001 From: elizabeth Date: Thu, 12 Dec 2024 14:47:36 -0500 Subject: [PATCH] forge fmt --- src/MockAggregator.sol | 21 ++++++++++++--------- src/interfaces/AggregatorInterface.sol | 14 +++++++------- src/interfaces/AggregatorV3Interface.sol | 21 +++++++++++---------- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/MockAggregator.sol b/src/MockAggregator.sol index e0c0081..d913353 100644 --- a/src/MockAggregator.sol +++ b/src/MockAggregator.sol @@ -6,10 +6,10 @@ import {AstriaOracle} from "./AstriaOracle.sol"; // Mock currency pair aggregator contract for a single currency pair. contract MockAggregator is AggregatorV2V3Interface { // core oracle contract - AstriaOracle immutable public oracle; + AstriaOracle public immutable oracle; // currency pair hash - bytes32 immutable public currencyPairHash; + bytes32 public immutable currencyPairHash; constructor(AstriaOracle _oracle, bytes32 _currencyPairHash) { oracle = _oracle; @@ -17,9 +17,9 @@ contract MockAggregator is AggregatorV2V3Interface { } /* v2 aggregator interface */ - + function latestAnswer() external view returns (int256) { - (uint128 price, ) = oracle.priceData(oracle.latestBlockNumber(), currencyPairHash); + (uint128 price,) = oracle.priceData(oracle.latestBlockNumber(), currencyPairHash); return int256(uint256(price)); } @@ -33,7 +33,7 @@ contract MockAggregator is AggregatorV2V3Interface { } function getAnswer(uint256 roundId) external view returns (int256) { - (uint128 price, ) = oracle.priceData(roundId, currencyPairHash); + (uint128 price,) = oracle.priceData(roundId, currencyPairHash); return int256(uint256(price)); } @@ -56,9 +56,11 @@ contract MockAggregator is AggregatorV2V3Interface { return 0; } - function getRoundData( - uint80 _roundId - ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) { + function getRoundData(uint80 _roundId) + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) + { (uint128 price, uint256 timestamp) = oracle.priceData(_roundId, currencyPairHash); return (_roundId, int256(uint256(price)), timestamp, timestamp, _roundId); } @@ -66,7 +68,8 @@ contract MockAggregator is AggregatorV2V3Interface { function latestRoundData() external view - returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) { + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) + { roundId = uint80(oracle.latestBlockNumber()); (uint128 price, uint256 timestamp) = oracle.priceData(roundId, currencyPairHash); return (roundId, int256(uint256(price)), timestamp, timestamp, roundId); diff --git a/src/interfaces/AggregatorInterface.sol b/src/interfaces/AggregatorInterface.sol index 1bd8f90..18b0a11 100644 --- a/src/interfaces/AggregatorInterface.sol +++ b/src/interfaces/AggregatorInterface.sol @@ -4,17 +4,17 @@ pragma solidity ^0.8.0; // https://github.com/smartcontractkit/chainlink/blob/dde17518ff7f3dd3fe1d53614f211357944516f0/contracts/src/v0.8/shared/interfaces/AggregatorInterface.sol // solhint-disable-next-line interface-starts-with-i interface AggregatorInterface { - function latestAnswer() external view returns (int256); + function latestAnswer() external view returns (int256); - function latestTimestamp() external view returns (uint256); + function latestTimestamp() external view returns (uint256); - function latestRound() external view returns (uint256); + function latestRound() external view returns (uint256); - function getAnswer(uint256 roundId) external view returns (int256); + function getAnswer(uint256 roundId) external view returns (int256); - function getTimestamp(uint256 roundId) external view returns (uint256); + function getTimestamp(uint256 roundId) external view returns (uint256); - event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt); + event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt); - event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); + event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); } diff --git a/src/interfaces/AggregatorV3Interface.sol b/src/interfaces/AggregatorV3Interface.sol index f04e06c..8e9c246 100644 --- a/src/interfaces/AggregatorV3Interface.sol +++ b/src/interfaces/AggregatorV3Interface.sol @@ -4,18 +4,19 @@ pragma solidity ^0.8.0; // https://github.com/smartcontractkit/chainlink/blob/dde17518ff7f3dd3fe1d53614f211357944516f0/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol // solhint-disable-next-line interface-starts-with-i interface AggregatorV3Interface { - function decimals() external view returns (uint8); + function decimals() external view returns (uint8); - function description() external view returns (string memory); + function description() external view returns (string memory); - function version() external view returns (uint256); + function version() external view returns (uint256); - function getRoundData( - uint80 _roundId - ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); + function getRoundData(uint80 _roundId) + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); - function latestRoundData() - external - view - returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); + function latestRoundData() + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); }