diff --git a/.github/workflows/certora.yml b/.github/workflows/certora.yml index d9aa08af..6d14d3a3 100644 --- a/.github/workflows/certora.yml +++ b/.github/workflows/certora.yml @@ -18,7 +18,9 @@ on: jobs: verify: runs-on: ubuntu-latest - if: github.event.pull_request.head.repo.full_name == github.repository + if: + github.event.pull_request.head.repo.full_name == github.repository || (github.event_name == 'push' && + github.ref == format('refs/heads/{0}', github.event.repository.default_branch)) steps: - uses: actions/checkout@v4 diff --git a/tests/utils/ProtocolV3TestBase.sol b/tests/utils/ProtocolV3TestBase.sol index 3007f4ba..92c03293 100644 --- a/tests/utils/ProtocolV3TestBase.sol +++ b/tests/utils/ProtocolV3TestBase.sol @@ -401,14 +401,7 @@ contract ProtocolV3TestBase is DiffUtils { vars.configs = new ReserveConfig[](vars.reserves.length); for (uint256 i = 0; i < vars.reserves.length; i++) { - vars.configs[i] = _getStructReserveConfig(pool, vars.reserves[i]); - ReserveTokens memory reserveTokens = _getStructReserveTokens( - poolDataProvider, - vars.configs[i].underlying - ); - vars.configs[i].aToken = reserveTokens.aToken; - vars.configs[i].variableDebtToken = reserveTokens.variableDebtToken; - vars.configs[i].stableDebtToken = reserveTokens.stableDebtToken; + vars.configs[i] = _getStructReserveConfig(pool, poolDataProvider, vars.reserves[i]); } return vars.configs; @@ -427,12 +420,22 @@ contract ProtocolV3TestBase is DiffUtils { function _getStructReserveConfig( IPool pool, + IPoolDataProvider poolDataProvider, IPoolDataProvider.TokenData memory reserve ) internal view virtual returns (ReserveConfig memory) { ReserveConfig memory localConfig; DataTypes.ReserveConfigurationMap memory configuration = pool.getConfiguration( reserve.tokenAddress ); + + localConfig.underlying = reserve.tokenAddress; + ReserveTokens memory reserveTokens = _getStructReserveTokens( + poolDataProvider, + reserve.tokenAddress + ); + localConfig.aToken = reserveTokens.aToken; + localConfig.variableDebtToken = reserveTokens.variableDebtToken; + localConfig.stableDebtToken = reserveTokens.stableDebtToken; localConfig.interestRateStrategy = pool .getReserveData(reserve.tokenAddress) .interestRateStrategyAddress; @@ -452,7 +455,6 @@ contract ProtocolV3TestBase is DiffUtils { localConfig.isPaused ) = configuration.getFlags(); localConfig.symbol = reserve.symbol; - localConfig.underlying = reserve.tokenAddress; localConfig.usageAsCollateralEnabled = localConfig.liquidationThreshold != 0; localConfig.isSiloed = configuration.getSiloedBorrowing(); (localConfig.borrowCap, localConfig.supplyCap) = configuration.getCaps(); @@ -467,10 +469,10 @@ contract ProtocolV3TestBase is DiffUtils { if (localConfig.virtualAccActive) { localConfig.virtualBalance = pool.getVirtualUnderlyingBalance(reserve.tokenAddress); - localConfig.aTokenUnderlyingBalance = IERC20Detailed(reserve.tokenAddress).balanceOf( - localConfig.aToken - ); } + localConfig.aTokenUnderlyingBalance = IERC20Detailed(reserve.tokenAddress).balanceOf( + localConfig.aToken + ); return localConfig; }