From 8fc4e7870171702d39c306981200f66dde3ebaff Mon Sep 17 00:00:00 2001 From: Kingster Date: Sat, 23 Mar 2024 16:00:53 -0700 Subject: [PATCH] fix lint --- contracts/registries/IPAssetRegistry.sol | 3 -- .../foundry/integration/BaseIntegration.t.sol | 54 +++++++++---------- .../modules/dispute/ArbitrationPolicySP.t.sol | 5 +- test/foundry/utils/DeployHelper.t.sol | 7 +-- 4 files changed, 29 insertions(+), 40 deletions(-) diff --git a/contracts/registries/IPAssetRegistry.sol b/contracts/registries/IPAssetRegistry.sol index c2af1ce25..4e6ee69e6 100644 --- a/contracts/registries/IPAssetRegistry.sol +++ b/contracts/registries/IPAssetRegistry.sol @@ -10,8 +10,6 @@ import { IIPAccount } from "../interfaces/IIPAccount.sol"; import { IIPAssetRegistry } from "../interfaces/registries/IIPAssetRegistry.sol"; import { IPAccountRegistry } from "../registries/IPAccountRegistry.sol"; import { Errors } from "../lib/Errors.sol"; -import { IPAccountChecker } from "contracts/lib/registries/IPAccountChecker.sol"; -import { IModuleRegistry } from "../interfaces/registries/IModuleRegistry.sol"; import { Governable } from "../governance/Governable.sol"; import { IPAccountStorageOps } from "../lib/IPAccountStorageOps.sol"; @@ -102,5 +100,4 @@ contract IPAssetRegistry is IIPAssetRegistry, IPAccountRegistry, Governable { if (id != ipAccount(chainId, tokenContract, tokenId)) return false; return bytes(IIPAccount(payable(id)).getString("NAME")).length != 0; } - } diff --git a/test/foundry/integration/BaseIntegration.t.sol b/test/foundry/integration/BaseIntegration.t.sol index 1cb4c10be..14530ec3d 100644 --- a/test/foundry/integration/BaseIntegration.t.sol +++ b/test/foundry/integration/BaseIntegration.t.sol @@ -116,35 +116,35 @@ contract BaseIntegration is BaseTest { parentIpIds[i] = licenseRegistry.licensorIpId(licenseIds[i]); } - vm.expectEmit(); - emit IERC6551Registry.ERC6551AccountCreated({ - account: expectedAddr, - implementation: address(ipAccountImpl), - salt: ipAccountRegistry.IP_ACCOUNT_SALT(), - chainId: block.chainid, - tokenContract: nft, - tokenId: tokenId - }); + vm.expectEmit(); + emit IERC6551Registry.ERC6551AccountCreated({ + account: expectedAddr, + implementation: address(ipAccountImpl), + salt: ipAccountRegistry.IP_ACCOUNT_SALT(), + chainId: block.chainid, + tokenContract: nft, + tokenId: tokenId + }); - vm.expectEmit(); - emit IIPAccountRegistry.IPAccountRegistered({ - account: expectedAddr, - implementation: address(ipAccountImpl), - chainId: block.chainid, - tokenContract: nft, - tokenId: tokenId - }); + vm.expectEmit(); + emit IIPAccountRegistry.IPAccountRegistered({ + account: expectedAddr, + implementation: address(ipAccountImpl), + chainId: block.chainid, + tokenContract: nft, + tokenId: tokenId + }); - vm.expectEmit(); - emit IIPAssetRegistry.IPRegistered({ - ipId: expectedAddr, - chainId: block.chainid, - tokenContract: nft, - tokenId: tokenId, - name: string.concat(block.chainid.toString(), ": Ape #", tokenId.toString()), - uri: string.concat("https://storyprotocol.xyz/erc721/", tokenId.toString()), - registrationDate: block.timestamp - }); + vm.expectEmit(); + emit IIPAssetRegistry.IPRegistered({ + ipId: expectedAddr, + chainId: block.chainid, + tokenContract: nft, + tokenId: tokenId, + name: string.concat(block.chainid.toString(), ": Ape #", tokenId.toString()), + uri: string.concat("https://storyprotocol.xyz/erc721/", tokenId.toString()), + registrationDate: block.timestamp + }); address ipId = ipAssetRegistry.register(nft, tokenId); diff --git a/test/foundry/modules/dispute/ArbitrationPolicySP.t.sol b/test/foundry/modules/dispute/ArbitrationPolicySP.t.sol index 73a6ad0c9..222b7650a 100644 --- a/test/foundry/modules/dispute/ArbitrationPolicySP.t.sol +++ b/test/foundry/modules/dispute/ArbitrationPolicySP.t.sol @@ -67,10 +67,7 @@ contract TestArbitrationPolicySP is BaseTest { vm.label(expectedAddr, "IPAccount0"); vm.startPrank(u.admin); - ipAddr = ipAssetRegistry.register( - address(mockNFT), - 0 - ); + ipAddr = ipAssetRegistry.register(address(mockNFT), 0); licensingModule.addPolicyToIp(ipAddr, policyIds["pil_cheap_flexible"]); // set arbitration policy diff --git a/test/foundry/utils/DeployHelper.t.sol b/test/foundry/utils/DeployHelper.t.sol index a98064416..8b5c9cc1a 100644 --- a/test/foundry/utils/DeployHelper.t.sol +++ b/test/foundry/utils/DeployHelper.t.sol @@ -41,7 +41,6 @@ import { MockERC20 } from "../mocks/token/MockERC20.sol"; import { MockERC721 } from "../mocks/token/MockERC721.sol"; import { TestProxyHelper } from "./TestProxyHelper.sol"; - contract DeployHelper { // TODO: three options, auto/mock/real in deploy condition, so that we don't need to manually // call getXXX to get mock contract (if there's no real contract deployed). @@ -222,11 +221,7 @@ contract DeployHelper { console2.log("DeployHelper: Using REAL IPAccountRegistry"); // TODO: Allow using mock IPAssetRegistry, instead of forcing deployment of actual IPAssetRegistry. - ipAssetRegistry = new IPAssetRegistry( - address(erc6551Registry), - address(ipAccountImpl), - getGovernance() - ); + ipAssetRegistry = new IPAssetRegistry(address(erc6551Registry), address(ipAccountImpl), getGovernance()); console2.log("DeployHelper: Using REAL IPAssetRegistry"); if (d.licenseRegistry) {