Skip to content

Commit

Permalink
escrow tests fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bulbozaur committed Nov 22, 2024
1 parent b2a3ee2 commit 94669d7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/unit/Escrow.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {PercentD16, PercentsD16} from "contracts/types/PercentD16.sol";
import {Escrow, LockedAssetsTotals, VetoerState} from "contracts/Escrow.sol";

import {EscrowState as EscrowStateLib, State as EscrowState} from "contracts/libraries/EscrowState.sol";
import {WithdrawalsBatchesQueue} from "contracts/libraries/WithdrawalBatchesQueue.sol";
import {WithdrawalsBatchesQueue} from "contracts/libraries/WithdrawalsBatchesQueue.sol";
import {AssetsAccounting, UnstETHRecordStatus} from "contracts/libraries/AssetsAccounting.sol";

import {IEscrow} from "contracts/interfaces/IEscrow.sol";
Expand Down Expand Up @@ -483,7 +483,7 @@ contract EscrowUnitTests is UnitTest {
vm.expectEmit();
emit EscrowStateLib.RageQuitStarted(Durations.ZERO, Durations.ZERO);
vm.expectEmit();
emit WithdrawalsBatchesQueue.WithdrawalBatchesQueueOpened(lri);
emit WithdrawalsBatchesQueue.WithdrawalsBatchesQueueOpened(lri);

transitToRageQuit();
}
Expand All @@ -504,7 +504,7 @@ contract EscrowUnitTests is UnitTest {
uint256[] memory unstEthIds = getUnstEthIdsFromWQ();

vm.expectEmit();
emit WithdrawalsBatchesQueue.WithdrawalBatchesQueueOpened(unstEthIds[0] - 1);
emit WithdrawalsBatchesQueue.WithdrawalsBatchesQueueOpened(unstEthIds[0] - 1);
transitToRageQuit();

WithdrawalQueueMock(_withdrawalQueue).setRequestWithdrawalsResult(unstEthIds);
Expand All @@ -516,7 +516,7 @@ contract EscrowUnitTests is UnitTest {
vm.expectEmit();
emit WithdrawalsBatchesQueue.UnstETHIdsAdded(unstEthIds);
vm.expectEmit();
emit WithdrawalsBatchesQueue.WithdrawalBatchesQueueClosed();
emit WithdrawalsBatchesQueue.WithdrawalsBatchesQueueClosed();
_escrow.requestNextWithdrawalsBatch(100);
}

Expand Down Expand Up @@ -547,7 +547,7 @@ contract EscrowUnitTests is UnitTest {
uint256[] memory unstEthIds = getUnstEthIdsFromWQ();

vm.expectEmit();
emit WithdrawalsBatchesQueue.WithdrawalBatchesQueueOpened(unstEthIds[0] - 1);
emit WithdrawalsBatchesQueue.WithdrawalsBatchesQueueOpened(unstEthIds[0] - 1);
transitToRageQuit();

WithdrawalQueueMock(_withdrawalQueue).setRequestWithdrawalsResult(unstEthIds);
Expand Down Expand Up @@ -1497,9 +1497,11 @@ contract EscrowUnitTests is UnitTest {
}

function ensureWithdrawalsBatchesQueueClosed() internal {
vm.expectEmit();
emit WithdrawalsBatchesQueue.WithdrawalBatchesQueueClosed();
_escrow.requestNextWithdrawalsBatch(100);
if (!_escrow.isWithdrawalsBatchesFinalized()) {
vm.expectEmit();
emit WithdrawalsBatchesQueue.WithdrawalsBatchesQueueClosed();
_escrow.requestNextWithdrawalsBatch(100);
}
}

function ensureRageQuitExtensionPeriodStartedNow() internal {
Expand Down

0 comments on commit 94669d7

Please sign in to comment.