Skip to content

Commit 4645871

Browse files
authored
test: remove testFail* tests (#643)
In preparation to deprecate `testFail*`: foundry-rs/foundry#9574 - Removes `deployMockERC721` and `deployMockERC20` from `StdUtils` as their tests includes large amount of `testFail*` tests and is generally outdated. I haven't been able to find the `deploy*` methods being used in any public project on Github. - Implements workaround for other cases Alternatively we could upstream Solady's mocks and tests (which have been updated to not use `testFail*` but this feels out of place and would be incomplete (ERC4626, ERC6909, etc.. https://github.com/Vectorized/solady/tree/main/test/utils/mocks). I think it is most common for people to rely on the mocks their library comes with (be it Solmate, Solady or OpenZeppelin) or write their own wrapper around the token implementation.
1 parent 999be66 commit 4645871

File tree

7 files changed

+20
-1651
lines changed

7 files changed

+20
-1651
lines changed

src/StdUtils.sol

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ pragma solidity >=0.6.2 <0.9.0;
44
pragma experimental ABIEncoderV2;
55

66
import {IMulticall3} from "./interfaces/IMulticall3.sol";
7-
import {MockERC20} from "./mocks/MockERC20.sol";
8-
import {MockERC721} from "./mocks/MockERC721.sol";
97
import {VmSafe} from "./Vm.sol";
108

119
abstract contract StdUtils {
@@ -119,21 +117,6 @@ abstract contract StdUtils {
119117
return vm.computeCreate2Address(salt, initCodeHash);
120118
}
121119

122-
/// @dev returns an initialized mock ERC20 contract
123-
function deployMockERC20(string memory name, string memory symbol, uint8 decimals)
124-
internal
125-
returns (MockERC20 mock)
126-
{
127-
mock = new MockERC20();
128-
mock.initialize(name, symbol, decimals);
129-
}
130-
131-
/// @dev returns an initialized mock ERC721 contract
132-
function deployMockERC721(string memory name, string memory symbol) internal returns (MockERC721 mock) {
133-
mock = new MockERC721();
134-
mock.initialize(name, symbol);
135-
}
136-
137120
/// @dev returns the hash of the init code (creation code + no args) used in CREATE2 with no constructor arguments
138121
/// @param creationCode the creation code of a contract C, as returned by type(C).creationCode
139122
function hashInitCode(bytes memory creationCode) internal pure returns (bytes32) {

src/mocks/MockERC20.sol

Lines changed: 0 additions & 234 deletions
This file was deleted.

0 commit comments

Comments
 (0)