Skip to content

Commit

Permalink
fix(test): modify tests to work w/ the latest protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsadface committed Sep 2, 2024
1 parent 15f9260 commit 902def1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion test/SPGNFT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Errors } from "../contracts/lib/Errors.sol";
import { BaseTest } from "./utils/BaseTest.t.sol";

contract SPGNFTTest is BaseTest {
address internal feeRecipient;
string internal nftMetadataEmpty;
string internal nftMetadataDefault;

Expand Down
15 changes: 10 additions & 5 deletions test/StoryProtocolGateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ contract StoryProtocolGatewayTest is BaseTest {
address owner;
}

address internal feeRecipient;

mapping(uint256 index => IPAsset) internal ipAsset;
address internal ipIdParent;

Expand Down Expand Up @@ -433,14 +431,17 @@ contract StoryProtocolGatewayTest is BaseTest {
nftContracts = new ISPGNFT[](10);
bytes[] memory data = new bytes[](10);
for (uint256 i = 0; i < 10; i++) {
data[i] = abi.encodeWithSignature(
"createCollection(string,string,uint32,uint256,address,address)",
data[i] = abi.encodeWithSelector(
spg.createCollection.selector,
"Test Collection",
"TEST",
100,
100 * 10 ** mockToken.decimals(),
address(mockToken),
minter
feeRecipient,
minter,
true,
false
);
}

Expand All @@ -455,6 +456,10 @@ contract StoryProtocolGatewayTest is BaseTest {
assertEq(nftContracts[i].totalSupply(), 0);
assertTrue(nftContracts[i].hasRole(SPGNFTLib.MINTER_ROLE, alice));
assertEq(nftContracts[i].mintFee(), 100 * 10 ** mockToken.decimals());
assertEq(nftContracts[i].mintFeeToken(), address(mockToken));
assertEq(nftContracts[i].mintFeeRecipient(), bob);
assertTrue(nftContracts[i].mintOpen());
assertFalse(nftContracts[i].publicMinting());
}
}

Expand Down
11 changes: 3 additions & 8 deletions test/utils/BaseTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ contract BaseTest is Test {
impl = address(0); // Make sure we don't deploy wrong impl
address ipAccountRegistry = address(ipAssetRegistry);

impl = address(new AccessController());
impl = address(new AccessController(address(ipAssetRegistry), address(moduleRegistry)));
accessController = AccessController(
TestProxyHelper.deployUUPSProxy(
create3Deployer,
Expand Down Expand Up @@ -278,6 +278,7 @@ contract BaseTest is Test {
impl = address(0); // Make sure we don't deploy wrong impl
impl = address(
new RoyaltyModule(
_getDeployedAddress(type(LicensingModule).name),
address(disputeModule),
address(licenseRegistry),
address(ipAssetRegistry)
Expand All @@ -302,6 +303,7 @@ contract BaseTest is Test {
new LicensingModule(
address(accessController),
address(ipAccountRegistry),
address(moduleRegistry),
address(royaltyModule),
address(licenseRegistry),
address(disputeModule),
Expand Down Expand Up @@ -480,13 +482,6 @@ contract BaseTest is Test {
moduleRegistry.registerModule("CORE_METADATA_VIEW_MODULE", address(coreMetadataViewModule));
moduleRegistry.registerModule("GROUPING_MODULE", address(groupingModule));

accessController.setAddresses(address(ipAssetRegistry), address(moduleRegistry));
licenseRegistry.setDisputeModule(address(disputeModule));
licenseRegistry.setLicensingModule(address(licensingModule));
licenseToken.setLicensingModule(address(licensingModule));
licenseToken.setDisputeModule(address(disputeModule));
royaltyModule.setLicensingModule(address(licensingModule));

coreMetadataViewModule.updateCoreMetadataModule();
licenseRegistry.registerLicenseTemplate(address(pilTemplate));

Expand Down

0 comments on commit 902def1

Please sign in to comment.