@@ -9,6 +9,8 @@ import {DataCompressorV2_10} from "../data/DataCompressor_2_1.sol";
99import {DataCompressorV3_00} from "../data/DataCompressor_3_0.sol " ;
1010import {CreditAccountData, CreditManagerData, PoolData, TokenBalance, ContractAdapter} from "../data/Types.sol " ;
1111
12+ import {NetworkDetector} from "@gearbox-protocol/sdk-gov/contracts/NetworkDetector.sol " ;
13+
1214import "forge-std/console.sol " ;
1315
1416address constant ap = 0x5BcB06c56e8F28da0b038a373199240ca3F5a2f4 ;
@@ -17,7 +19,20 @@ contract DCTest {
1719 DataCompressorV2_10 public dc2;
1820 DataCompressorV3_00 public dc3;
1921
20- function setUp () public {
22+ uint256 chainId;
23+
24+ constructor () {
25+ NetworkDetector nd = new NetworkDetector ();
26+ chainId = nd.chainId ();
27+ }
28+
29+ modifier liveTestOnly () {
30+ if (chainId == 1 ) {
31+ _;
32+ }
33+ }
34+
35+ function setUp () public liveTestOnly {
2136 dc2 = new DataCompressorV2_10 (ap);
2237 dc3 = new DataCompressorV3_00 (ap);
2338 }
@@ -94,7 +109,7 @@ contract DCTest {
94109 }
95110 }
96111
97- function test_dc_01_pools () public view {
112+ function test_dc_01_pools () public view liveTestOnly {
98113 PoolData[] memory pools = dc2.getPoolsV1List ();
99114 console.log ("V1 pools " );
100115 _printPools (pools);
@@ -104,7 +119,7 @@ contract DCTest {
104119 _printPools (pools);
105120 }
106121
107- function test_dc_02_credit_managers () public view {
122+ function test_dc_02_credit_managers () public view liveTestOnly {
108123 CreditManagerData[] memory cms = dc2.getCreditManagersV2List ();
109124 console.log ("V2 credit managers " );
110125 _printCreditManagers (cms);
@@ -114,7 +129,7 @@ contract DCTest {
114129 _printCreditManagers (cms);
115130 }
116131
117- function test_dc_03_credit_accounts () public view {
132+ function test_dc_03_credit_accounts () public view liveTestOnly {
118133 CreditAccountData[] memory cas = dc2.getCreditAccountsByBorrower (address (this ));
119134 console.log ("V2 credit accounts " , cas.length );
120135 }
0 commit comments