From 767d51cc9337f4d7de43b53ddecb57ed9bb264a2 Mon Sep 17 00:00:00 2001 From: Andrei Kozlov Date: Wed, 17 Jan 2024 13:47:05 +0700 Subject: [PATCH] use missing assets for tests --- lib/aave-address-book | 2 +- lib/forge-std | 2 +- src/lib/MissingAssetsMainnet.sol | 7 +++++++ tests/RETHPriceCapAdapterTest.t.sol | 7 ++++--- tests/WstETHPriceCapAdapterTest.t.sol | 12 +++++++----- 5 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 src/lib/MissingAssetsMainnet.sol diff --git a/lib/aave-address-book b/lib/aave-address-book index 74987ef..53cf0de 160000 --- a/lib/aave-address-book +++ b/lib/aave-address-book @@ -1 +1 @@ -Subproject commit 74987efdf365b2446943539cefe8b2df0cb85de4 +Subproject commit 53cf0de34f46e33b9da2e29d02cdd7a0c3006771 diff --git a/lib/forge-std b/lib/forge-std index 066ff16..36c303b 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 066ff16c5c03e6f931cd041fd366bc4be1fae82a +Subproject commit 36c303b7ffdd842d06b1ec2744c9b9b5fb3083f3 diff --git a/src/lib/MissingAssetsMainnet.sol b/src/lib/MissingAssetsMainnet.sol new file mode 100644 index 0000000..529f5b7 --- /dev/null +++ b/src/lib/MissingAssetsMainnet.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +library MissingAssetsMainnet { + address constant public RETH = 0xae78736Cd615f374D3085123A210448E74Fc6393; + address constant public STETH = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84; +} diff --git a/tests/RETHPriceCapAdapterTest.t.sol b/tests/RETHPriceCapAdapterTest.t.sol index 2e7c0be..0c50cf9 100644 --- a/tests/RETHPriceCapAdapterTest.t.sol +++ b/tests/RETHPriceCapAdapterTest.t.sol @@ -4,8 +4,9 @@ pragma solidity ^0.8.0; import {Test} from 'forge-std/Test.sol'; import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; -import {RETHPriceCapAdapter} from '../src/contracts/RETHPriceCapAdapter.sol'; import {BaseAggregatorsMainnet} from 'cl-synchronicity-price-adapter/lib/BaseAggregators.sol'; +import {RETHPriceCapAdapter} from '../src/contracts/RETHPriceCapAdapter.sol'; +import {MissingAssetsMainnet} from '../src/lib/MissingAssetsMainnet.sol'; contract RETHPriceCapAdapterTest is Test { function setUp() public { @@ -16,7 +17,7 @@ contract RETHPriceCapAdapterTest is Test { RETHPriceCapAdapter adapter = new RETHPriceCapAdapter( AaveV3Ethereum.ACL_MANAGER, BaseAggregatorsMainnet.ETH_USD_AGGREGATOR, - BaseAggregatorsMainnet.RETH, + MissingAssetsMainnet.RETH, 'rETH / ETH / USD', 1093801647000000000, 1703743921, @@ -36,7 +37,7 @@ contract RETHPriceCapAdapterTest is Test { RETHPriceCapAdapter adapter = new RETHPriceCapAdapter( AaveV3Ethereum.ACL_MANAGER, BaseAggregatorsMainnet.ETH_USD_AGGREGATOR, - BaseAggregatorsMainnet.RETH, + MissingAssetsMainnet.RETH, 'rETH / ETH / USD', 1093801647000000000, 1703743921, diff --git a/tests/WstETHPriceCapAdapterTest.t.sol b/tests/WstETHPriceCapAdapterTest.t.sol index 63e96a2..9b2d683 100644 --- a/tests/WstETHPriceCapAdapterTest.t.sol +++ b/tests/WstETHPriceCapAdapterTest.t.sol @@ -4,9 +4,11 @@ pragma solidity ^0.8.0; import {Test} from 'forge-std/Test.sol'; import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; -import {WstETHPriceCapAdapter} from '../src/contracts/WstETHPriceCapAdapter.sol'; import {BaseAggregatorsMainnet} from 'cl-synchronicity-price-adapter/lib/BaseAggregators.sol'; +import {WstETHPriceCapAdapter} from '../src/contracts/WstETHPriceCapAdapter.sol'; +import {MissingAssetsMainnet} from '../src/lib/MissingAssetsMainnet.sol'; + contract WstETHPriceCapAdapterTest is Test { function setUp() public { vm.createSelectFork(vm.rpcUrl('mainnet'), 18961286); @@ -16,7 +18,7 @@ contract WstETHPriceCapAdapterTest is Test { WstETHPriceCapAdapter adapter = new WstETHPriceCapAdapter( AaveV3Ethereum.ACL_MANAGER, BaseAggregatorsMainnet.ETH_USD_AGGREGATOR, - BaseAggregatorsMainnet.STETH, + MissingAssetsMainnet.STETH, 'wstETH/stETH/USD', 1151642949000000000, 1703743921, @@ -36,7 +38,7 @@ contract WstETHPriceCapAdapterTest is Test { WstETHPriceCapAdapter adapter = new WstETHPriceCapAdapter( AaveV3Ethereum.ACL_MANAGER, BaseAggregatorsMainnet.ETH_USD_AGGREGATOR, - BaseAggregatorsMainnet.STETH, + MissingAssetsMainnet.STETH, 'wstETH/stETH/USD', 1151642949000000000, 1703743921, @@ -56,7 +58,7 @@ contract WstETHPriceCapAdapterTest is Test { WstETHPriceCapAdapter adapter = new WstETHPriceCapAdapter( AaveV3Ethereum.ACL_MANAGER, BaseAggregatorsMainnet.ETH_USD_AGGREGATOR, - BaseAggregatorsMainnet.STETH, + MissingAssetsMainnet.STETH, 'wstETH/stETH/USD', 1151642949000000000, 1703743921, @@ -87,7 +89,7 @@ contract WstETHPriceCapAdapterTest is Test { WstETHPriceCapAdapter adapter = new WstETHPriceCapAdapter( AaveV3Ethereum.ACL_MANAGER, BaseAggregatorsMainnet.ETH_USD_AGGREGATOR, - BaseAggregatorsMainnet.STETH, + MissingAssetsMainnet.STETH, 'wstETH/stETH/USD', 1151642949000000000, 1703743921,