Skip to content

Commit

Permalink
Merge pull request #49 from Gearbox-protocol/legacy-test-fix
Browse files Browse the repository at this point in the history
fix: add exception for forbidden tokens in Convex eq test
  • Loading branch information
doomsower authored Aug 29, 2023
2 parents cde10cd + 8dff06b commit 5324a48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contracts/test/adapters/mainnet/Live_ConvexEquivalenceTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ contract Live_ConvexEquivalenceTest is DSTest, LiveEnvHelper {

/// HELPER

function _isSupportedPool(ICreditFacade creditFacade, address basePoolAdapter) internal view returns (bool) {
address spt = IConvexV1BaseRewardPoolAdapter(basePoolAdapter).stakedPhantomToken();

uint256 tokenMask = creditFacade.creditManager().tokenMasksMap(spt);

return (tokenMask != 0) && (creditFacade.creditManager().forbiddenTokenMask() & tokenMask == 0);
}

function _getTokensToTrack(address basePoolAdapter) internal view returns (Tokens[] memory tokensToTrack) {
address targetContract = IConvexV1BaseRewardPoolAdapter(basePoolAdapter).targetContract();

Expand Down Expand Up @@ -304,6 +312,8 @@ contract Live_ConvexEquivalenceTest is DSTest, LiveEnvHelper {

address basePoolAdapter = lts.getAdapter(address(creditFacade.creditManager()), convexPools[i]);

if (!_isSupportedPool(creditFacade, basePoolAdapter)) continue;

address creditAccount = openCreditAccountWithUnderlying(
creditFacade,
IConvexV1BaseRewardPoolAdapter(basePoolAdapter).curveLPtoken(),
Expand Down

0 comments on commit 5324a48

Please sign in to comment.