Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing tests for AaveV3LeverageStrategyExtension #147

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions test/integration/ethereum/aaveV3LeverageStrategyExtension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ if (process.env.INTEGRATIONTEST) {
context("when methodology settings are increased beyond default maximum", () => {
let newMethodology: MethodologySettings;
let newIncentive: IncentiveSettings;
const leverageCutoff = ether(2.2); // Value of leverage that can only be exceeded with eMode activated
const leverageCutoff = ether(2.21); // Value of leverage that can only be exceeded with eMode activated
beforeEach(() => {
subjectCaller = owner;
});
Expand Down Expand Up @@ -1958,7 +1958,7 @@ if (process.env.INTEGRATIONTEST) {
.rebalance(subjectExchangeToUse);
}

describe("when leverage ratio is above max and it drops further between rebalances", async () => {
describe("when leverage ratio is above max and rises further between rebalances", async () => {
it("should set the global and exchange timestamps correctly", async () => {
await subject();
const timestamp1 = await getLastBlockTimestamp();
Expand Down Expand Up @@ -3534,6 +3534,14 @@ if (process.env.INTEGRATIONTEST) {
await chainlinkCollateralPriceMock.setPrice(initialCollateralPrice);

subjectCaller = owner;

const oldExecution = await leverageStrategyExtension.getExecution();
const newExecution: ExecutionSettings = {
unutilizedLeveragePercentage: oldExecution.unutilizedLeveragePercentage,
twapCooldownPeriod: oldExecution.twapCooldownPeriod,
slippageTolerance: ether(0.05),
};
await leverageStrategyExtension.setExecutionSettings(newExecution);
});

async function subject(): Promise<any> {
Expand Down