From 6fa05b1fbba3901575769e50b60bafe2f4891603 Mon Sep 17 00:00:00 2001 From: Tina-57blocks Date: Tue, 3 Dec 2024 16:50:43 +0800 Subject: [PATCH] Add file level comment and fix review comment --- .env.example | 3 ++- test/hardhat/e2e/constants.ts | 6 +++++- test/hardhat/e2e/grouping/group.ipa.test.ts | 4 +++- test/hardhat/e2e/ipa/ipa.test.ts | 2 ++ test/hardhat/e2e/licenseTermsTemplate.ts | 2 ++ test/hardhat/e2e/permission/permission.test.ts | 2 ++ test/hardhat/e2e/setup.ts | 2 ++ test/hardhat/e2e/utils/mintNFTAndRegisterIPA.ts | 2 ++ test/hardhat/e2e/utils/nftHelper.ts | 2 ++ 9 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index e3cdc0e8..932ed274 100644 --- a/.env.example +++ b/.env.example @@ -18,4 +18,5 @@ ETHERSCAN_API_KEY = ETHERSCANAPIKEYETHERSCANAPIKEY DEVNET_URL = http:// DEVNET_CHAINID = 1315 DEVNET_PRIVATEKEY = -DEVNET_USER1 = \ No newline at end of file +DEVNET_USER1 = +DEVNET_ERC721 = diff --git a/test/hardhat/e2e/constants.ts b/test/hardhat/e2e/constants.ts index be11f0b7..3c101540 100644 --- a/test/hardhat/e2e/constants.ts +++ b/test/hardhat/e2e/constants.ts @@ -1,3 +1,5 @@ +// This is the deployed protocol address constants file. + export const AccessController = "0xf709c8001E94e2ca6F98b7fFBCd5BD3943E46D81"; export const CoreMetadataModule = "0x89630Ccf23277417FBdfd3076C702F5248267e78"; export const CoreMetadataViewModule = "0x6839De4A647eE2311bd765f615E09f7bd930ed25"; @@ -21,4 +23,6 @@ export const ProtocolPauseAdmin = "0x65C6Ec6Cc074eaf7ba3970C540b4379C9BcA8A67"; export const RoyaltyModule = "0xEa6eD700b11DfF703665CCAF55887ca56134Ae3B"; export const RoyaltyPolicyLAP = "0x28b4F70ffE5ba7A26aEF979226f77Eb57fb9Fdb6"; export const RoyaltyPolicyLRP = "0x7D2d9af4E4ab14Afcfd86436BC348928B40963Dd"; -export const MockERC721 = "0x7a23aad16b2ac6ad74f76990a814b0f82bec83b8"; + +// Mock ERC721 contract address +export const MockERC721 = process.env.DEVNET_ERC721 as string; diff --git a/test/hardhat/e2e/grouping/group.ipa.test.ts b/test/hardhat/e2e/grouping/group.ipa.test.ts index fcdd6c57..365305a2 100644 --- a/test/hardhat/e2e/grouping/group.ipa.test.ts +++ b/test/hardhat/e2e/grouping/group.ipa.test.ts @@ -1,3 +1,5 @@ +// Test: Group IP Asset + import "../setup" import { expect } from "chai" import { EvenSplitGroupPool } from "../constants" @@ -19,4 +21,4 @@ describe("Group IPA", function () { this.groupingModule.registerGroup(nonWhitelistedGroupPool) ).to.be.rejectedWith(Error) }); -}); \ No newline at end of file +}); diff --git a/test/hardhat/e2e/ipa/ipa.test.ts b/test/hardhat/e2e/ipa/ipa.test.ts index 6c014a34..df0a909f 100644 --- a/test/hardhat/e2e/ipa/ipa.test.ts +++ b/test/hardhat/e2e/ipa/ipa.test.ts @@ -1,3 +1,5 @@ +// Test: IP Asset + import "../setup" import { expect } from "chai" import { mintNFT } from "../utils/nftHelper" diff --git a/test/hardhat/e2e/licenseTermsTemplate.ts b/test/hardhat/e2e/licenseTermsTemplate.ts index b19c2586..36477628 100644 --- a/test/hardhat/e2e/licenseTermsTemplate.ts +++ b/test/hardhat/e2e/licenseTermsTemplate.ts @@ -1,3 +1,5 @@ +// This file is used to define the terms of a license that will be used in the tests. + import hre from "hardhat"; export const terms = { diff --git a/test/hardhat/e2e/permission/permission.test.ts b/test/hardhat/e2e/permission/permission.test.ts index d55979f3..1fb5843d 100644 --- a/test/hardhat/e2e/permission/permission.test.ts +++ b/test/hardhat/e2e/permission/permission.test.ts @@ -1,3 +1,5 @@ +// Test: Permission + import "../setup" import { expect } from "chai" import { mintNFT } from "../utils/nftHelper" diff --git a/test/hardhat/e2e/setup.ts b/test/hardhat/e2e/setup.ts index 88ef79d3..4ce98511 100644 --- a/test/hardhat/e2e/setup.ts +++ b/test/hardhat/e2e/setup.ts @@ -1,3 +1,5 @@ +// This file is a root hook used to setup preconditions before running the tests. + import hre from "hardhat"; import { network } from "hardhat"; import { GroupingModule, IPAssetRegistry, LicenseRegistry, LicenseToken, LicensingModule, PILicenseTemplate, RoyaltyPolicyLAP, MockERC20, RoyaltyPolicyLRP, AccessController } from "./constants"; diff --git a/test/hardhat/e2e/utils/mintNFTAndRegisterIPA.ts b/test/hardhat/e2e/utils/mintNFTAndRegisterIPA.ts index 60bcfc34..ca3dd99c 100644 --- a/test/hardhat/e2e/utils/mintNFTAndRegisterIPA.ts +++ b/test/hardhat/e2e/utils/mintNFTAndRegisterIPA.ts @@ -1,3 +1,5 @@ +// Purpose: Helper function to mint an NFT and register it as an IP Asset. + import "../setup"; import { mintNFT } from "./nftHelper"; import { MockERC721, IPAssetRegistry } from "../constants"; diff --git a/test/hardhat/e2e/utils/nftHelper.ts b/test/hardhat/e2e/utils/nftHelper.ts index 08490dbf..313fcfd0 100644 --- a/test/hardhat/e2e/utils/nftHelper.ts +++ b/test/hardhat/e2e/utils/nftHelper.ts @@ -1,3 +1,5 @@ +// Purpose: Helper function to mint a new NFT and return the tokenId + import hre from "hardhat" import { MockERC721 } from "../constants"; import { ethers } from "ethers";