Skip to content

Commit

Permalink
test: remove 'depositERC20' related tests and fix outdated ones
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielstoica committed Jul 25, 2024
1 parent 1b4b1e1 commit 5a39d8e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 80 deletions.
63 changes: 0 additions & 63 deletions test/unit/concrete/container/deposit-erc20/depositERC20.t.sol

This file was deleted.

9 changes: 0 additions & 9 deletions test/unit/concrete/container/deposit-erc20/depositERC20.tree

This file was deleted.

4 changes: 2 additions & 2 deletions test/unit/concrete/container/receive/receive.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ contract Receive_Unit_Concrete_Test is Container_Unit_Concrete_Test {
// Make Bob the caller for this test suite
vm.startPrank({ msgSender: users.bob });

// Expect the {AssetDeposited} event to be emitted upon ETH deposit
// Expect the {NativeDeposited} event to be emitted upon ETH deposit
vm.expectEmit();
emit Events.AssetDeposited({ sender: users.bob, asset: address(0), amount: 1 ether });
emit Events.NativeDeposited({ sender: users.bob, amount: 1 ether });

// Run the test
(bool success, ) = address(container).call{ value: 1 ether }("");
Expand Down
2 changes: 1 addition & 1 deletion test/unit/concrete/container/receive/receive.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
receive.t.sol
└── it should emit an {AssetDeposited} event
└── it should emit an {NativeDeposited} event
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ contract WithdrawERC20_Unit_Concrete_Test is Container_Unit_Concrete_Test {
// Approve the {Container} contract to spend USDT tokens on behalf of Eve
usdt.approve({ spender: address(container), amount: 100e6 });

// Deposit sufficient ERC-20 tokens into the container to enable the withdrawal
container.depositERC20({ asset: IERC20(address(usdt)), amount: 100e6 });
// Deposit enough ERC-20 tokens into the container to enable the withdrawal
usdt.transfer({ recipient: address(container), amount: 100e6 });
_;
}

Expand Down
5 changes: 2 additions & 3 deletions test/utils/Events.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ abstract contract Events {
CONTAINER
//////////////////////////////////////////////////////////////////////////*/

/// @notice Emitted when an `amount` amount of `asset` ERC-20 asset is deposited on the container
/// @notice Emitted when an `amount` amount of `asset` native tokens (ETH) is deposited on the container
/// @param sender The address of the depositor
/// @param asset The address of the deposited ERC-20 token
/// @param amount The amount of the deposited ERC-20 token
event AssetDeposited(address indexed sender, address indexed asset, uint256 amount);
event NativeDeposited(address indexed sender, uint256 amount);

/// @notice Emitted when an `amount` amount of `asset` ERC-20 asset is withdrawn from the container
/// @param sender The address to which the tokens were transferred
Expand Down

0 comments on commit 5a39d8e

Please sign in to comment.