From 496e6f25e87e1502cfb0b7756fd005dcbd7883d2 Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Tue, 17 Dec 2024 18:09:33 +0000 Subject: [PATCH] test: fix .only in tests --- test/0.8.25/vaults/dashboard/dashboard.test.ts | 10 +++++++--- .../vaults/delegation/delegation.test.ts | 18 +++++++++--------- .../vaults/staking-vault/staking-vault.test.ts | 4 ++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/test/0.8.25/vaults/dashboard/dashboard.test.ts b/test/0.8.25/vaults/dashboard/dashboard.test.ts index 8faeb599a..999e81cdb 100644 --- a/test/0.8.25/vaults/dashboard/dashboard.test.ts +++ b/test/0.8.25/vaults/dashboard/dashboard.test.ts @@ -1,10 +1,10 @@ -import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; import { expect } from "chai"; import { randomBytes } from "crypto"; import { ZeroAddress } from "ethers"; import { ethers } from "hardhat"; -import { certainAddress, ether, findEvents } from "lib"; -import { Snapshot } from "test/suite"; + +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; + import { Dashboard, DepositContract__MockForStakingVault, @@ -14,6 +14,10 @@ import { VaultHub__MockForDashboard, } from "typechain-types"; +import { certainAddress, ether, findEvents } from "lib"; + +import { Snapshot } from "test/suite"; + describe("Dashboard", () => { let factoryOwner: HardhatEthersSigner; let vaultOwner: HardhatEthersSigner; diff --git a/test/0.8.25/vaults/delegation/delegation.test.ts b/test/0.8.25/vaults/delegation/delegation.test.ts index ebd15dce6..83eb0bc7f 100644 --- a/test/0.8.25/vaults/delegation/delegation.test.ts +++ b/test/0.8.25/vaults/delegation/delegation.test.ts @@ -1,9 +1,9 @@ -import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; import { expect } from "chai"; import { keccak256 } from "ethers"; import { ethers } from "hardhat"; -import { advanceChainTime, days, ether, findEvents, getNextBlockTimestamp, impersonate, streccak } from "lib"; -import { Snapshot } from "test/suite"; + +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; + import { Delegation, DepositContract__MockForStakingVault, @@ -13,17 +13,17 @@ import { VaultHub__MockForDelegation, } from "typechain-types"; +import { advanceChainTime, days, ether, findEvents, getNextBlockTimestamp, impersonate } from "lib"; + +import { Snapshot } from "test/suite"; + const BP_BASE = 10000n; const MAX_FEE = BP_BASE; describe("Delegation", () => { - let deployer: HardhatEthersSigner; let vaultOwner: HardhatEthersSigner; let manager: HardhatEthersSigner; let operator: HardhatEthersSigner; - let staker: HardhatEthersSigner; - let keyMaster: HardhatEthersSigner; - let tokenMaster: HardhatEthersSigner; let stranger: HardhatEthersSigner; let factoryOwner: HardhatEthersSigner; let hubSigner: HardhatEthersSigner; @@ -40,8 +40,7 @@ describe("Delegation", () => { let originalState: string; before(async () => { - [deployer, vaultOwner, manager, staker, operator, keyMaster, tokenMaster, stranger, factoryOwner] = - await ethers.getSigners(); + [, vaultOwner, manager, operator, stranger, factoryOwner] = await ethers.getSigners(); steth = await ethers.deployContract("StETH__MockForDelegation"); delegationImpl = await ethers.deployContract("Delegation", [steth]); @@ -63,6 +62,7 @@ describe("Delegation", () => { const vaultCreationTx = await factory .connect(vaultOwner) .createVault({ managementFee: 0n, performanceFee: 0n, manager, operator }, "0x"); + const vaultCreationReceipt = await vaultCreationTx.wait(); if (!vaultCreationReceipt) throw new Error("Vault creation receipt not found"); diff --git a/test/0.8.25/vaults/staking-vault/staking-vault.test.ts b/test/0.8.25/vaults/staking-vault/staking-vault.test.ts index f457350b0..be50098a0 100644 --- a/test/0.8.25/vaults/staking-vault/staking-vault.test.ts +++ b/test/0.8.25/vaults/staking-vault/staking-vault.test.ts @@ -3,7 +3,7 @@ import { ZeroAddress } from "ethers"; import { ethers } from "hardhat"; import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; -import { getStorageAt, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { setBalance } from "@nomicfoundation/hardhat-network-helpers"; import { DepositContract__MockForStakingVault, @@ -23,7 +23,7 @@ const MAX_INT128 = 2n ** 127n - 1n; const MAX_UINT128 = 2n ** 128n - 1n; // @TODO: test reentrancy attacks -describe.only("StakingVault", () => { +describe("StakingVault", () => { let vaultOwner: HardhatEthersSigner; let operator: HardhatEthersSigner; let stranger: HardhatEthersSigner;