@@ -28,18 +28,6 @@ contract WstEthChainlinkAdapterTest is Test {
28
28
oracle.latestRoundData ();
29
29
}
30
30
31
- function testGetRoundDataOverflow (uint256 ethByShares ) public {
32
- ethByShares = bound (ethByShares, uint256 (type (int256 ).max) + 1 , type (uint256 ).max);
33
-
34
- vm.mockCall (
35
- address (ST_ETH),
36
- abi.encodeWithSelector (ST_ETH.getPooledEthByShares.selector , 10 ** 18 ),
37
- abi.encode (ethByShares)
38
- );
39
- vm.expectRevert (bytes (ErrorsLib.OVERFLOW));
40
- oracle.getRoundData (1 );
41
- }
42
-
43
31
function testDecimals () public {
44
32
assertEq (oracle.decimals (), uint8 (18 ));
45
33
}
@@ -49,24 +37,20 @@ contract WstEthChainlinkAdapterTest is Test {
49
37
new WstEthChainlinkAdapter (address (0 ));
50
38
}
51
39
52
- function testConfig () public {
40
+ function testDescription () public {
53
41
assertEq (oracle.description (), "wstETH/ETH exchange rate " );
54
- assertEq (oracle.version (), 1 );
55
42
}
43
+ function testReverts () public {
44
+ vm.expectRevert ();
45
+ oracle.version ();
56
46
57
- function testLatestRoundData () public {
58
- (uint80 roundId , int256 answer , uint256 startedAt , uint256 updatedAt , uint80 answeredInRound ) =
59
- oracle.latestRoundData ();
60
- assertEq (roundId, 0 );
61
- assertEq (uint256 (answer), ST_ETH.getPooledEthByShares (10 ** 18 ));
62
- assertEq (startedAt, 0 );
63
- assertEq (updatedAt, 0 );
64
- assertEq (answeredInRound, 0 );
47
+ vm.expectRevert ();
48
+ oracle.getRoundData (0 );
65
49
}
66
50
67
- function testGetRoundData () public {
51
+ function testLatestRoundData () public {
68
52
(uint80 roundId , int256 answer , uint256 startedAt , uint256 updatedAt , uint80 answeredInRound ) =
69
- oracle.getRoundData ( 1 );
53
+ oracle.latestRoundData ( );
70
54
assertEq (roundId, 0 );
71
55
assertEq (uint256 (answer), ST_ETH.getPooledEthByShares (10 ** 18 ));
72
56
assertEq (startedAt, 0 );
@@ -87,19 +71,6 @@ contract WstEthChainlinkAdapterTest is Test {
87
71
assertEq (uint256 (answer), ethByShares);
88
72
}
89
73
90
- function testGetRoundDataNoOverflow (uint256 ethByShares ) public {
91
- ethByShares = bound (ethByShares, 0 , uint256 (type (int256 ).max));
92
-
93
- vm.mockCall (
94
- address (ST_ETH),
95
- abi.encodeWithSelector (ST_ETH.getPooledEthByShares.selector , 10 ** 18 ),
96
- abi.encode (ethByShares)
97
- );
98
-
99
- (, int256 answer ,,,) = oracle.getRoundData (1 );
100
- assertEq (uint256 (answer), ethByShares);
101
- }
102
-
103
74
function testLatestRoundDataBounds () public {
104
75
(, int256 answer ,,,) = oracle.latestRoundData ();
105
76
assertGe (uint256 (answer), 1154690031824824994 ); // Exchange rate queried at block 19070943
0 commit comments