Skip to content

Commit

Permalink
another tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kyzia551 committed Jan 29, 2024
1 parent 8e7ca13 commit 35f5393
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/contracts/SDAIGnosisPriceCapAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract SDAIGnosisPriceCapAdapter is PriceCapAdapterBase {
daiToBaseAggregatorAddress,
sDaiAddress,
pairName,
IERC4626(sDaiAddress).decimals(),
18,
minimumSnapshotDelay,
priceCapParams
)
Expand Down
9 changes: 6 additions & 3 deletions tests/BaseTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ abstract contract BaseTest is Test {
365 days;
vm.assume(snapshotRatio + maxRatioGrowthInMinimalLifetime <= type(uint104).max);

IPriceCapAdapter.PriceCapUpdateParams memory priceCapParams;
priceCapParams.snapshotRatio = snapshotRatio;
priceCapParams.snapshotTimestamp = snapshotTimestamp;
priceCapParams.maxYearlyRatioGrowthPercent = maxYearlyRatioGrowthPercent;

vm.mockCall(
baseAggregatorAddress,
abi.encodeWithSelector(ICLSynchronicityPriceAdapter.decimals.selector),
Expand All @@ -145,9 +150,7 @@ abstract contract BaseTest is Test {
ratioProviderAddress,
pairDescription,
minimumSnapshotDelay,
snapshotRatio,
snapshotTimestamp,
maxYearlyRatioGrowthPercent
priceCapParams
);
assertEq(address(adapter.ACL_MANAGER()), address(aclManager), 'aclManager not set properly');
assertEq(
Expand Down
6 changes: 0 additions & 6 deletions tests/SDAIGnosisPriceCapAdapterTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import './BaseTest.sol';
import {AaveV3Gnosis, AaveV3GnosisAssets} from 'aave-address-book/AaveV3Gnosis.sol';
import {BaseAggregatorsGnosis} from 'cl-synchronicity-price-adapter/lib/BaseAggregators.sol';
import {IERC4626} from 'forge-std/interfaces/IERC4626.sol';
import {IERC20} from 'forge-std/interfaces/IERC20.sol';

import {SDAIGnosisPriceCapAdapter} from '../src/contracts/SDAIGnosisPriceCapAdapter.sol';

Expand All @@ -21,11 +20,6 @@ contract SDAIGnosisPriceCapAdapterTest is BaseTest {
uint48 minimumSnapshotDelay,
IPriceCapAdapter.PriceCapUpdateParams memory priceCapParams
) public override returns (IPriceCapAdapter) {
vm.mockCall(
ratioProviderAddress,
abi.encodeWithSelector(IERC20.decimals.selector),
abi.encode(18)
);
return
new SDAIGnosisPriceCapAdapter(
aclManager,
Expand Down

0 comments on commit 35f5393

Please sign in to comment.