From 9dd9bea9ace8cfd6008813a7deddb04160ae3949 Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Thu, 27 Feb 2025 10:36:49 +0000 Subject: [PATCH] fix: make test work again --- test/0.8.25/Protocol__Deployment.t.sol | 5 ++++- test/0.8.25/ShareRate.t.sol | 25 +++++++------------------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/test/0.8.25/Protocol__Deployment.t.sol b/test/0.8.25/Protocol__Deployment.t.sol index ac819895f..7e1c8c868 100644 --- a/test/0.8.25/Protocol__Deployment.t.sol +++ b/test/0.8.25/Protocol__Deployment.t.sol @@ -130,6 +130,9 @@ contract BaseProtocolTest is Test { address public lidoTreasuryAdr = makeAddr("dummy-lido:treasury"); address public wstETHAdr = makeAddr("dummy-locator:wstETH"); + uint256 public constant VAULTS_LIMIT = 500; + uint256 public constant VAULTS_RELATIVE_SHARE_LIMIT = 10_00; + LimitsList public limitList = LimitsList({ exitedValidatorsPerDayLimit: 9000, @@ -197,7 +200,7 @@ contract BaseProtocolTest is Test { // Add accounting contract with handler to the protocol address accountingImpl = deployCode( "Accounting.sol:Accounting", - abi.encode([address(lidoLocator), lidoProxyAddress]) + abi.encode(address(lidoLocator), lidoProxyAddress, VAULTS_LIMIT, VAULTS_RELATIVE_SHARE_LIMIT) ); deployCodeTo( diff --git a/test/0.8.25/ShareRate.t.sol b/test/0.8.25/ShareRate.t.sol index af3643350..f4827c2ee 100644 --- a/test/0.8.25/ShareRate.t.sol +++ b/test/0.8.25/ShareRate.t.sol @@ -2,20 +2,20 @@ // for testing purposes only pragma solidity ^0.8.0; -import "./Protocol__Deployment.t.sol"; -import "@openzeppelin/contracts-v4.4/utils/StorageSlot.sol"; import "contracts/0.8.9/EIP712StETH.sol"; -import {BaseProtocolTest, ILido} from "./Protocol__Deployment.t.sol"; -import {CommonBase} from "forge-std/Base.sol"; -import {LidoLocator} from "contracts/0.8.9/LidoLocator.sol"; +import {CommonBase} from "forge-std/Base.sol"; import {StdCheats} from "forge-std/StdCheats.sol"; import {StdUtils} from "forge-std/StdUtils.sol"; -import {StorageSlot} from "@openzeppelin/contracts-v4.4/utils/StorageSlot.sol"; import {Vm} from "forge-std/Vm.sol"; -import {console2} from "../../foundry/lib/forge-std/src/console2.sol"; import {console2} from "forge-std/console2.sol"; +import {StorageSlot} from "@openzeppelin/contracts-v4.4/utils/StorageSlot.sol"; + +import {LidoLocator} from "contracts/0.8.9/LidoLocator.sol"; + +import {BaseProtocolTest, WithdrawalQueue, ILido} from "./Protocol__Deployment.t.sol"; + uint256 constant ONE_DAY_IN_BLOCKS = 7_200; contract ShareRateHandler is CommonBase, StdCheats, StdUtils { @@ -108,16 +108,6 @@ contract ShareRateHandler is CommonBase, StdCheats, StdUtils { return false; } - ( - bool isStakingPaused_, - bool isStakingLimitSet, - uint256 currentStakeLimit, - uint256 maxStakeLimit, - uint256 maxStakeLimitGrowthBlocks, - uint256 prevStakeLimit, - uint256 prevStakeBlockNumber - ) = lidoContract.getStakeLimitFullInfo(); - if (_amountETH > 1000 ether || _amountETH == 0) { _amountETH = bound(_amountETH, 1, 1000 ether); } @@ -199,7 +189,6 @@ contract ShareRateTest is BaseProtocolTest { address private userAccount = address(0x321); function setUp() public { - keccak256("lido.StETH.totalShares"); BaseProtocolTest.setUpProtocol(protocolStartBalance, rootAccount, userAccount); address accountingContract = lidoLocator.accounting();