From e036de0d586759a8e32e9e14855e3172335fb2d5 Mon Sep 17 00:00:00 2001 From: alvrs Date: Mon, 30 Oct 2023 21:18:52 +0100 Subject: [PATCH] add test for installing twice --- packages/world-modules/test/ERC721.t.sol | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/world-modules/test/ERC721.t.sol b/packages/world-modules/test/ERC721.t.sol index 22078401b23..17bf5595afa 100644 --- a/packages/world-modules/test/ERC721.t.sol +++ b/packages/world-modules/test/ERC721.t.sol @@ -137,6 +137,22 @@ contract ERC721Test is Test, GasReporter, IERC721Events, IERC721Errors { assertEq(NamespaceOwner.get(WorldResourceIdLib.encodeNamespace("myERC721")), address(this)); } + function testInstallTwice() public { + // Install the ERC721 module again + IERC721Mintable anotherToken = registerERC721( + world, + "anotherERC721", + ERC721MetadataData({ name: "Token", symbol: "TKN", baseURI: "" }) + ); + assertTrue(address(anotherToken) != address(0)); + assertTrue(address(anotherToken) != address(token)); + } + + ///////////////////////////////////////////////// + // SOLADY ERC721 TEST CAES + // (https://github.com/Vectorized/solady/blob/main/test/ERC721.t.sol) + ///////////////////////////////////////////////// + function testMint(uint256 id, address owner) public { vm.assume(owner != address(0));