Skip to content

Commit

Permalink
test: partially restore negative rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tamtamchik committed Feb 12, 2025
1 parent dd28196 commit b19caf9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"test:integration": "hardhat test test/integration/**/*.ts",
"test:integration:trace": "hardhat test test/integration/**/*.ts --trace --disabletracer",
"test:integration:fulltrace": "hardhat test test/integration/**/*.ts --fulltrace --disabletracer",
"test:integration:scratch": "HARDHAT_FORKING_URL= INTEGRATION_WITH_CSM=off INTEGRATION_WITH_SCRATCH_DEPLOY=on hardhat test test/integration/**/*.ts",
"test:integration:scratch:trace": "HARDHAT_FORKING_URL= INTEGRATION_WITH_CSM=off INTEGRATION_WITH_SCRATCH_DEPLOY=on hardhat test test/integration/**/*.ts --trace --disabletracer",
"test:integration:scratch:fulltrace": "HARDHAT_FORKING_URL= INTEGRATION_WITH_CSM=off INTEGRATION_WITH_SCRATCH_DEPLOY=on hardhat test test/integration/**/*.ts --fulltrace --disabletracer",
"test:integration:scratch": "HARDHAT_FORKING_URL= INTEGRATION_WITH_CSM=off hardhat test test/integration/**/*.ts",
"test:integration:scratch:trace": "HARDHAT_FORKING_URL= INTEGRATION_WITH_CSM=off hardhat test test/integration/**/*.ts --trace --disabletracer",
"test:integration:scratch:fulltrace": "HARDHAT_FORKING_URL= INTEGRATION_WITH_CSM=off hardhat test test/integration/**/*.ts --fulltrace --disabletracer",
"test:integration:fork:local": "hardhat test test/integration/**/*.ts --network local",
"test:integration:fork:mainnet": "hardhat test test/integration/**/*.ts --network mainnet-fork",
"test:integration:fork:mainnet:custom": "hardhat test --network mainnet-fork",
Expand Down
20 changes: 11 additions & 9 deletions test/integration/negative-rebase.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import { report } from "lib/protocol/helpers";

import { Snapshot } from "test/suite";

// TODO: check why it fails on CI, but works locally
// e.g. https://github.com/lidofinance/core/actions/runs/12390882454/job/34586841193
describe("Integration: Negative rebase", () => {
let ctx: ProtocolContext;
let beforeSnapshot: string;
let beforeEachSnapshot: string;
let ethHolder: HardhatEthersSigner;

let snapshot: string;
let originalState: string;

before(async () => {
beforeSnapshot = await Snapshot.take();
ctx = await getProtocolContext();

snapshot = await Snapshot.take();

[ethHolder] = await ethers.getSigners();
await setBalance(ethHolder.address, ether("1000000"));
const network = await ethers.provider.getNetwork();
Expand All @@ -40,11 +40,11 @@ describe("Integration: Negative rebase", () => {
}
});

after(async () => await Snapshot.restore(beforeSnapshot));
beforeEach(async () => (originalState = await Snapshot.take()));

beforeEach(async () => (beforeEachSnapshot = await Snapshot.take()));
afterEach(async () => await Snapshot.restore(originalState));

afterEach(async () => await Snapshot.restore(beforeEachSnapshot));
after(async () => await Snapshot.restore(snapshot)); // Rollback to the initial state pre deployment

const exitedValidatorsCount = async () => {
const ids = await ctx.contracts.stakingRouter.getStakingModuleIds();
Expand Down Expand Up @@ -83,7 +83,9 @@ describe("Integration: Negative rebase", () => {
expect(beforeLastReportData.totalExitedValidators).to.be.equal(lastExitedTotal);
});

it("Should store correctly many negative rebases", async () => {
// TODO: check why it fails on CI, but works locally
// e.g. https://github.com/lidofinance/core/actions/runs/12390882454/job/34586841193
it.skip("Should store correctly many negative rebases", async () => {
const { locator, oracleReportSanityChecker } = ctx.contracts;

expect((await locator.oracleReportSanityChecker()) == oracleReportSanityChecker.address);
Expand Down

0 comments on commit b19caf9

Please sign in to comment.