Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/data-feeds/BasicDataConsumerV3.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract BasicDataConsumerV3Test is Test {
consumer = new BasicDataConsumerV3(ETH_USD_AGGREGATOR_ADDRESS);
}

function test_forkSmoke() public {
function test_forkSmoke() public view {
assertEq(vm.activeFork(), ethereumMainnetForkId);

int256 answer = consumer.getChainlinkDataFeedLatestAnswer();
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/data-streams/DataStreamsConsumerFork.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contract DataStreamsConsumerForkTest is Test {
dataStreamsLocalSimulatorFork = new DataStreamsLocalSimulatorFork();
}

function preTestHook() public returns (IVerifierProxy, IFeeManager, address, bytes memory) {
function preTestHook() public view returns (IVerifierProxy, IFeeManager, address, bytes memory) {
assertEq(vm.activeFork(), arbitrumSepoliaForkId);

Register.NetworkDetails memory networkDetails = dataStreamsLocalSimulatorFork.getNetworkDetails(block.chainid);
Expand All @@ -79,7 +79,7 @@ contract DataStreamsConsumerForkTest is Test {
return (verifierProxy, feeManager, rewardManager, reportData);
}

function postTestHook(ReportVersions.ReportV3 memory verifiedReport) public {
function postTestHook(ReportVersions.ReportV3 memory verifiedReport) public view {
assertEq(verifiedReport.feedId, EXPECTED_REPORT.feedId);
assertEq(verifiedReport.validFromTimestamp, EXPECTED_REPORT.validFromTimestamp);
assertEq(verifiedReport.observationsTimestamp, EXPECTED_REPORT.observationsTimestamp);
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/data-feeds/BasicDataConsumerV3.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract BasicDataConsumerV3Test is Test {
consumer = new BasicDataConsumerV3(address(mockEthUsdAggregator));
}

function test_smoke() public {
function test_smoke() public view {
int256 answer = consumer.getChainlinkDataFeedLatestAnswer();
assertEq(answer, initialAnswer, "answer should be equal to initialAnswer");
}
Expand Down
18 changes: 9 additions & 9 deletions test/unit/data-feeds/DataFeedsUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ contract BasicDataConsumerV3Test is Test {
mockOffchainAggregator = MockOffchainAggregator(mockAggregator.aggregator());
}

function test_shouldReturnDecimals() public {
function test_shouldReturnDecimals() public view {
uint8 result = mockAggregator.decimals();
assertEq(result, decimals);
}

function test_shouldReturnAnswerByRoundId() public {
function test_shouldReturnAnswerByRoundId() public view {
int256 result = mockAggregator.getAnswer(initialRoundId);
assertEq(result, initialAnswer);
}

function test_shouldReturnRoundDataByRoundId() public {
function test_shouldReturnRoundDataByRoundId() public view {
(uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) =
mockAggregator.getRoundData(initialRoundId);

Expand All @@ -46,7 +46,7 @@ contract BasicDataConsumerV3Test is Test {
assertEq(answeredInRound, initialRoundId);
}

function test_shouldReturnLatestRoundData() public {
function test_shouldReturnLatestRoundData() public view {
(uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) =
mockAggregator.latestRoundData();

Expand All @@ -57,22 +57,22 @@ contract BasicDataConsumerV3Test is Test {
assertEq(answeredInRound, initialRoundId);
}

function test_shouldReturnTimestampByRoundId() public {
function test_shouldReturnTimestampByRoundId() public view {
uint256 result = mockAggregator.getTimestamp(initialRoundId);
assertEq(result, deploymentTimestamp);
}

function test_shouldReturnLatestAnswer() public {
function test_shouldReturnLatestAnswer() public view {
int256 result = mockAggregator.latestAnswer();
assertEq(result, initialAnswer);
}

function test_shouldReturnLatestTimestamp() public {
function test_shouldReturnLatestTimestamp() public view {
uint256 result = mockAggregator.latestTimestamp();
assertEq(result, deploymentTimestamp);
}

function test_shouldReturnLatestRound() public {
function test_shouldReturnLatestRound() public view {
uint256 result = mockAggregator.latestRound();
assertEq(result, initialRoundId);
}
Expand Down Expand Up @@ -146,7 +146,7 @@ contract BasicDataConsumerV3Test is Test {
assertEq(result, newAnswer);
}

function test_shouldReturnMinAndMaxAnswers() public {
function test_shouldReturnMinAndMaxAnswers() public view {
int192 minAnswer = 1;
int192 maxAnswer = 95780971304118053647396689196894323976171195136475135; // type(uint176).max

Expand Down