Skip to content

Commit

Permalink
test(migration): add compoundV3 migration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oumar-fall committed Jan 15, 2025
1 parent 4212dd0 commit 371b613
Show file tree
Hide file tree
Showing 5 changed files with 465 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ async function fetchCompoundV2InstancePosition(

const chainId = parameters.chainId;

const migrationContracts =
MIGRATION_ADDRESSES[chainId][MigratableProtocol.compoundV2];

if (!migrationContracts) return null;

if (deployless) {
//TODO
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ async function fetchCompoundV3InstancePosition(
client: Client,
{ deployless = true, ...parameters }: DeploylessFetchParameters = {},
) {
parameters.chainId = ChainUtils.parseSupportedChainId(
parameters.chainId ?? (await getChainId(client)),
);

const chainId = parameters.chainId;

const migrationContracts =
MIGRATION_ADDRESSES[chainId][MigratableProtocol.aaveV2];

if (!migrationContracts) return null;

if (deployless) {
//TODO
}
Expand Down Expand Up @@ -143,7 +132,7 @@ export async function fetchCompoundV3Positions(
const chainId = parameters.chainId;

const migrationContracts =
MIGRATION_ADDRESSES[chainId][MigratableProtocol.aaveV2];
MIGRATION_ADDRESSES[chainId][MigratableProtocol.compoundV3];

if (!migrationContracts) return [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe("Supply position on COMPOUND V2", () => {

testFn("should fetch user position", async ({ client }) => {
const amount = parseUnits("10", underlyingDecimals);
await writeSupply(client, cToken, underlying, amount, false);
await writeSupply(client, cToken, underlying, amount);

const allPositions = await fetchMigratablePositions(
client.account.address,
Expand Down
Loading

0 comments on commit 371b613

Please sign in to comment.