Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsadface committed Sep 27, 2024
1 parent 13ebc9c commit 4cb964a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 57 deletions.
8 changes: 1 addition & 7 deletions test/integration/BaseIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ import { WorkflowStructs } from "../../contracts/lib/WorkflowStructs.sol";
import { StoryProtocolCoreAddressManager } from "../../script/utils/StoryProtocolCoreAddressManager.sol";
import { StoryProtocolPeripheryAddressManager } from "../../script/utils/StoryProtocolPeripheryAddressManager.sol";

contract BaseIntegration is
Test,
Script,
StoryProtocolCoreAddressManager,
StoryProtocolPeripheryAddressManager
{
contract BaseIntegration is Test, Script, StoryProtocolCoreAddressManager, StoryProtocolPeripheryAddressManager {
/// @dev Test user
address internal testSender;
uint256 internal testSenderSk;
Expand Down Expand Up @@ -118,7 +113,6 @@ contract BaseIntegration is
nftMetadataURI: "test-nft-uri",
nftMetadataHash: "test-nft-hash"
});

}

function _beginBroadcast() internal {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/workflows/DerivativeIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ contract DerivativeIntegration is BaseIntegration {
terms: PILFlavors.commercialUse({
mintingFee: testMintFee,
currencyToken: testMintFeeToken,
royaltyPolicy: royaltyPolicyLRPAddr
royaltyPolicy: royaltyPolicyLRPAddr
})
});

Expand Down
5 changes: 1 addition & 4 deletions test/integration/workflows/GroupingIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ contract GroupingIntegration is BaseIntegration {
}

// check the license terms is correctly attached to the group IPA
(address licenseTemplate, uint256 licenseTermsId) = licenseRegistry.getAttachedLicenseTerms(
newGroupId,
0
);
(address licenseTemplate, uint256 licenseTermsId) = licenseRegistry.getAttachedLicenseTerms(newGroupId, 0);
assertEq(licenseTemplate, testLicenseTemplate);
assertEq(licenseTermsId, testLicenseTermsId);
}
Expand Down
24 changes: 11 additions & 13 deletions test/integration/workflows/LicenseAttachmentIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ contract LicenseAttachmentIntegration is BaseIntegration {
StoryUSD.approve(address(spgNftContract), testMintFee);

(address ipId1, uint256 tokenId1, uint256 licenseTermsId1) = licenseAttachmentWorkflows
.mintAndRegisterIpAndAttachPILTerms({
spgNftContract: address(spgNftContract),
recipient: testSender,
ipMetadata: testIpMetadata,
terms: commUseTerms
});
.mintAndRegisterIpAndAttachPILTerms({
spgNftContract: address(spgNftContract),
recipient: testSender,
ipMetadata: testIpMetadata,
terms: commUseTerms
});
assertTrue(ipAssetRegistry.isRegistered(ipId1));
assertEq(tokenId1, spgNftContract.totalSupply());
assertEq(licenseTermsId1, pilTemplate.getLicenseTermsId(commUseTerms));
Expand Down Expand Up @@ -160,18 +160,16 @@ contract LicenseAttachmentIntegration is BaseIntegration {
deadline: deadline,
signature: sigMetadata
}),
sigAttach: WorkflowStructs.SignatureData({
signer: testSender,
deadline: deadline,
signature: sigAttach
})
sigAttach: WorkflowStructs.SignatureData({ signer: testSender, deadline: deadline, signature: sigAttach })
});

assertEq(ipId, expectedIpId);
assertTrue(ipAssetRegistry.isRegistered(ipId));
assertEq(IIPAccount(payable(ipId)).state(), expectedState);
(address expectedLicenseTemplate, uint256 expectedLicenseTermsId) = licenseRegistry
.getAttachedLicenseTerms(expectedIpId, 0);
(address expectedLicenseTemplate, uint256 expectedLicenseTermsId) = licenseRegistry.getAttachedLicenseTerms(
expectedIpId,
0
);
assertEq(expectedLicenseTemplate, pilTemplateAddr);
assertEq(expectedLicenseTermsId, licenseTermsId);
}
Expand Down
39 changes: 15 additions & 24 deletions test/integration/workflows/RegistrationIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ contract RegistrationIntegration is BaseIntegration {
spgNftContract = ISPGNFT(
registrationWorkflows.createCollection(
ISPGNFT.InitParams({
name: testCollectionName,
symbol: testCollectionSymbol,
baseURI: testBaseURI,
maxSupply: testMaxSupply,
mintFee: testMintFee,
mintFeeToken: testMintFeeToken,
mintFeeRecipient: testSender,
owner: testSender,
mintOpen: true,
isPublicMinting: true
}))
name: testCollectionName,
symbol: testCollectionSymbol,
baseURI: testBaseURI,
maxSupply: testMaxSupply,
mintFee: testMintFee,
mintFeeToken: testMintFeeToken,
mintFeeRecipient: testSender,
owner: testSender,
mintOpen: true,
isPublicMinting: true
})
)
);

assertEq(spgNftContract.name(), testCollectionName);
Expand All @@ -77,14 +78,10 @@ contract RegistrationIntegration is BaseIntegration {

assertEq(tokenId, 1);
assertTrue(ipAssetRegistry.isRegistered(ipId));
assertEq(
spgNftContract.tokenURI(tokenId),
string.concat(testBaseURI, testIpMetadata.nftMetadataURI)
);
assertEq(spgNftContract.tokenURI(tokenId), string.concat(testBaseURI, testIpMetadata.nftMetadataURI));
assertMetadata(ipId, testIpMetadata);
}


function _test_RegistrationIntegration_registerIp() private {
StoryUSD.mint(testSender, testMintFee);
StoryUSD.approve(address(spgNftContract), testMintFee);
Expand Down Expand Up @@ -117,10 +114,7 @@ contract RegistrationIntegration is BaseIntegration {
assertEq(actualIpId, expectedIpId);
assertEq(IIPAccount(payable(actualIpId)).state(), expectedState);
assertTrue(ipAssetRegistry.isRegistered(actualIpId));
assertEq(
spgNftContract.tokenURI(tokenId),
string.concat(testBaseURI, tokenId.toString())
);
assertEq(spgNftContract.tokenURI(tokenId), string.concat(testBaseURI, tokenId.toString()));
assertMetadata(actualIpId, testIpMetadata);
}

Expand Down Expand Up @@ -186,10 +180,7 @@ contract RegistrationIntegration is BaseIntegration {
for (uint256 i = 0; i < totalIps; i++) {
(ipIds[i], tokenIds[i]) = abi.decode(results[i], (address, uint256));
assertTrue(ipAssetRegistry.isRegistered(ipIds[i]));
assertEq(
spgNftContract.tokenURI(tokenIds[i]),
string.concat(testBaseURI, testIpMetadata.nftMetadataURI)
);
assertEq(spgNftContract.tokenURI(tokenIds[i]), string.concat(testBaseURI, testIpMetadata.nftMetadataURI));
assertMetadata(ipIds[i], testIpMetadata);
}
}
Expand Down
12 changes: 4 additions & 8 deletions test/integration/workflows/RoyaltyIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ contract RoyaltyIntegration is BaseIntegration {
}

function _test_RoyaltyIntegration_transferToVaultAndSnapshotAndClaimBySnapshotBatch() private {
// setup IP graph and takes 3 snapshots of ancestor IP's royalty vault
// setup IP graph and takes 3 snapshots of ancestor IP's royalty vault
uint256 numSnapshots = 3;
_setupIpGraph(numSnapshots);

Expand Down Expand Up @@ -191,7 +191,7 @@ contract RoyaltyIntegration is BaseIntegration {
}

function _test_RoyaltyIntegration_snapshotAndClaimByTokenBatch() private {
// setup IP graph with no snapshot
// setup IP graph with no snapshot
uint256 numSnapshots = 0;
_setupIpGraph(numSnapshots);

Expand Down Expand Up @@ -219,7 +219,7 @@ contract RoyaltyIntegration is BaseIntegration {
}

function _test_RoyaltyIntegration_snapshotAndClaimBySnapshotBatch() private {
// setup IP graph and takes 1 snapshot of ancestor IP's royalty vault
// setup IP graph and takes 1 snapshot of ancestor IP's royalty vault
uint256 numSnapshots = 1;
_setupIpGraph(numSnapshots);

Expand Down Expand Up @@ -391,11 +391,7 @@ contract RoyaltyIntegration is BaseIntegration {
ancestorIpRoyaltyVault.totalSupply()
);

IIPAccount(payable(ancestorIpId)).execute({
to: address(ancestorIpRoyaltyVault),
value: 0,
data: data
});
IIPAccount(payable(ancestorIpId)).execute({ to: address(ancestorIpRoyaltyVault), value: 0, data: data });
}

// takes a snapshot of the ancestor IP's royalty vault and populates unclaimedSnapshotIds
Expand Down

0 comments on commit 4cb964a

Please sign in to comment.