Skip to content

Commit

Permalink
fix: test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
koderholic committed Sep 16, 2024
1 parent 46df999 commit b9277f0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 89 deletions.
1 change: 0 additions & 1 deletion contracts/src/RedeemManager.1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import "./Initializable.sol";
import "./state/shared/RiverAddress.sol";
import "./state/redeemManager/RedeemQueue.1.sol";
import "./state/redeemManager/RedeemQueue.2.sol";
import "./state/redeemManager/RedeemQueue.1.2.sol";
import "./state/redeemManager/WithdrawalStack.sol";
import "./state/redeemManager/BufferedExceedingEth.sol";
import "./state/redeemManager/RedeemDemand.sol";
Expand Down
32 changes: 0 additions & 32 deletions contracts/src/state/redeemManager/RedeemQueue.1.2.sol

This file was deleted.

56 changes: 0 additions & 56 deletions contracts/test/RedeemManager.1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import "../src/state/shared/RiverAddress.sol";
import "../src/state/redeemManager/RedeemDemand.sol";
import "../src/state/redeemManager/RedeemQueue.1.sol";
import "../src/state/redeemManager/RedeemQueue.2.sol";
import "../src/state/redeemManager/RedeemQueue.1.2.sol";

import "../src/state/redeemManager/WithdrawalStack.sol";
import "../src/RedeemManager.1.sol";
Expand Down Expand Up @@ -2029,61 +2028,6 @@ contract MockRedeemManagerV1 is MockRedeemManagerV1Base {
}
}

contract MockRedeemManagerV1_2 is MockRedeemManagerV1Base {
function getRedeemRequestDetails(uint32 _redeemRequestId)
external
view
returns (RedeemQueueV1_2.RedeemRequest memory)
{
return RedeemQueueV1_2.get()[_redeemRequestId];
}

function requestRedeem(uint256 _lsETHAmount, address _recipient)
external
onlyRedeemerOrRiver
returns (uint32 redeemRequestId)
{
IRiverV1 river = _castedRiver();
if (IAllowlistV1(river.getAllowlist()).isDenied(_recipient)) {
revert RecipientIsDenied();
}
return _requestRedeem(_lsETHAmount, _recipient);
}

function _requestRedeem(uint256 _lsETHAmount, address _recipient) internal returns (uint32 redeemRequestId) {
LibSanitize._notZeroAddress(_recipient);
if (_lsETHAmount == 0) {
revert InvalidZeroAmount();
}
if (!_castedRiver().transferFrom(msg.sender, address(this), _lsETHAmount)) {
revert TransferError();
}
RedeemQueueV1_2.RedeemRequest[] storage redeemRequests = RedeemQueueV1_2.get();
redeemRequestId = uint32(redeemRequests.length);
uint256 height = 0;
if (redeemRequestId != 0) {
RedeemQueueV1_2.RedeemRequest memory previousRedeemRequest = redeemRequests[redeemRequestId - 1];
height = previousRedeemRequest.height + previousRedeemRequest.amount;
}

uint256 maxRedeemableEth = _castedRiver().underlyingBalanceFromShares(_lsETHAmount);

redeemRequests.push(
RedeemQueueV1_2.RedeemRequest({
height: height,
amount: _lsETHAmount,
recipient: _recipient,
initiator: msg.sender,
maxRedeemableEth: maxRedeemableEth
})
);

_setRedeemDemand(RedeemDemand.get() + _lsETHAmount);

emit RequestedRedeem(_recipient, height, _lsETHAmount, maxRedeemableEth, redeemRequestId);
}
}

contract InitializeRedeemManagerV1_2Test is RedeeManagerV1TestBase {
address[] public prevInitiators;
address public admin = address(0x123);
Expand Down

0 comments on commit b9277f0

Please sign in to comment.