Skip to content

Commit

Permalink
fix: make test work again
Browse files Browse the repository at this point in the history
  • Loading branch information
tamtamchik committed Feb 27, 2025
1 parent e158cc0 commit 9dd9bea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
5 changes: 4 additions & 1 deletion test/0.8.25/Protocol__Deployment.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
25 changes: 7 additions & 18 deletions test/0.8.25/ShareRate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 9dd9bea

Please sign in to comment.