Skip to content

Commit

Permalink
Fix incorrect variable names and code comments errors in test code (#380
Browse files Browse the repository at this point in the history
)
  • Loading branch information
offensif authored Feb 9, 2025
1 parent a0cddb1 commit ee30963
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ contract BigBang_Integration_SingleNftCollection is BaseIntegration {
registerDerivativeWithLicenseTokens(ipAcct[tokenId], alice_license_from_root_bob, "", u.alice);
}

// Carl mints licenses and linkts to multiple parents
// Carl mints licenses and links to multiple parents
// Carl creates NFT 6 IPAccount
// Carl activates the license on his NFT 6 IPAccount, linking as child to Alice's NFT 1 IPAccount
{
Expand Down
2 changes: 1 addition & 1 deletion test/hardhat/e2e/grouping/group.ipa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe("Add/Remove IP from Group IPA", function () {

// IP has different license term attached
await expect(
this.licensingModule.attachLicenseTerms(ipId, PILicenseTemplate, this.commericialUseLicenseId)
this.licensingModule.attachLicenseTerms(ipId, PILicenseTemplate, this.commercialUseLicenseId)
).not.to.be.rejectedWith(Error).then((tx) => tx.wait());
await expect(
this.groupingModule.addIp(groupId, [ipId], 20 * 10 ** 6)
Expand Down
4 changes: 2 additions & 2 deletions test/hardhat/e2e/license/attachLicenseTerms.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ describe("LicensingModule - attachLicenseTerms", function () {
expect(ipId).to.not.be.empty.and.to.be.a("HexString");

const connectedLicensingModule = this.licensingModule.connect(signers[0]);
console.log(this.nonCommericialLicenseId);
console.log(this.nonCommercialLicenseId);

const attachLicenseTx = await expect(
connectedLicensingModule.attachLicenseTerms(ipId, PILicenseTemplate, this.commericialUseLicenseId)
connectedLicensingModule.attachLicenseTerms(ipId, PILicenseTemplate, this.commercialUseLicenseId)
).not.to.be.rejectedWith(Error);
await attachLicenseTx.wait();
console.log(attachLicenseTx.hash);
Expand Down
14 changes: 9 additions & 5 deletions test/hardhat/e2e/license/mintLicenseTokens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("LicensingModule - mintLicenseTokens", function () {
const connectedLicensingModule = this.licensingModule.connect(signers[0]);

const attachLicenseTx = await expect(
connectedLicensingModule.attachLicenseTerms(ipId, PILicenseTemplate, this.nonCommericialLicenseId)
connectedLicensingModule.attachLicenseTerms(ipId, PILicenseTemplate, this.nonCommercialLicenseId)
).not.to.be.rejectedWith(Error);
expect(attachLicenseTx.hash).to.not.be.empty.and.to.be.a("HexString");
});
Expand All @@ -33,7 +33,8 @@ describe("LicensingModule - mintLicenseTokens", function () {
const connectedLicensingModule = this.licensingModule.connect(signers[0]);

const mintLicenseTokensTx = await expect(
connectedLicensingModule.mintLicenseTokens(ipId, PILicenseTemplate, this.nonCommericialLicenseId, 2, signers[0].address, hre.ethers.ZeroAddress, 0, 50 * 10 ** 6)

connectedLicensingModule.mintLicenseTokens(ipId, PILicenseTemplate, this.nonCommercialLicenseId, 2, signers[0].address, hre.ethers.ZeroAddress, 0, 50 * 10 ** 6)
).not.to.be.rejectedWith(Error);
expect(mintLicenseTokensTx.hash).to.not.be.empty.and.to.be.a("HexString");

Expand All @@ -46,7 +47,8 @@ describe("LicensingModule - mintLicenseTokens", function () {
const nonOwnerLicensingModule = this.licensingModule.connect(signers[1]);

const mintLicenseTokensTx = await expect(
nonOwnerLicensingModule.mintLicenseTokens(ipId, PILicenseTemplate, this.nonCommericialLicenseId, 2, signers[0].address, hre.ethers.ZeroAddress, 0, 50 * 10 ** 6)

nonOwnerLicensingModule.mintLicenseTokens(ipId, PILicenseTemplate, this.nonCommercialLicenseId, 2, signers[0].address, hre.ethers.ZeroAddress, 0, 50 * 10 ** 6)
).not.to.be.rejectedWith(Error);
expect(mintLicenseTokensTx.hash).to.not.be.empty.and.to.be.a("HexString");

Expand All @@ -59,15 +61,17 @@ describe("LicensingModule - mintLicenseTokens", function () {
const connectedLicensingModule = this.licensingModule.connect(signers[0]);

const mintLicenseTokensTx = await expect(
connectedLicensingModule.mintLicenseTokens(ipId, PILicenseTemplate, this.nonCommericialLicenseId, 0, signers[0].address, hre.ethers.ZeroAddress, 0, 50 * 10 ** 6)

connectedLicensingModule.mintLicenseTokens(ipId, PILicenseTemplate, this.nonCommercialLicenseId, 0, signers[0].address, hre.ethers.ZeroAddress, 0, 50 * 10 ** 6)
).to.be.rejectedWith("execution reverted");
});

it("Mint license tokens with different receivers", async function () {
const nonOwnerLicensingModule = this.licensingModule.connect(signers[0]);

const mintLicenseTokensTx = await expect(
nonOwnerLicensingModule.mintLicenseTokens(ipId, PILicenseTemplate, this.nonCommericialLicenseId, 2, signers[1].address, hre.ethers.ZeroAddress, 0, 50 * 10 ** 6)

nonOwnerLicensingModule.mintLicenseTokens(ipId, PILicenseTemplate, this.nonCommercialLicenseId, 2, signers[1].address, hre.ethers.ZeroAddress, 0, 50 * 10 ** 6)
).not.to.be.rejectedWith(Error);
expect(mintLicenseTokensTx.hash).to.not.be.empty.and.to.be.a("HexString");

Expand Down
8 changes: 4 additions & 4 deletions test/hardhat/e2e/license/registerDerivative.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("LicensingModule - registerDerivative", function () {
const connectedLicensingModule = this.licensingModule.connect(signers[0]);
// IP1 attach a non-commercial license
const attachLicenseTx = await expect(
connectedLicensingModule.attachLicenseTerms(ipId1, PILicenseTemplate, this.nonCommericialLicenseId)
connectedLicensingModule.attachLicenseTerms(ipId1, PILicenseTemplate, this.nonCommercialLicenseId)
).not.to.be.rejectedWith(Error);
await attachLicenseTx.wait();
console.log("Attach license transaction hash: ", attachLicenseTx.hash);
Expand All @@ -37,7 +37,7 @@ describe("LicensingModule - registerDerivative", function () {
// IP2 is registered as IP1's derivative
const user1ConnectedLicensingModule = this.licensingModule.connect(signers[1]);
const registerDerivativeTx = await expect(
user1ConnectedLicensingModule.registerDerivative(ipId2, [ipId1], [this.nonCommericialLicenseId], PILicenseTemplate, hre.ethers.ZeroAddress, 0, 0, 50 * 10 ** 6)
user1ConnectedLicensingModule.registerDerivative(ipId2, [ipId1], [this.nonCommercialLicenseId], PILicenseTemplate, hre.ethers.ZeroAddress, 0, 0, 50 * 10 ** 6)
).not.to.be.rejectedWith(Error);
await registerDerivativeTx.wait();
console.log("Register derivative transaction hash: ", registerDerivativeTx.hash);
Expand All @@ -53,7 +53,7 @@ describe("LicensingModule - registerDerivative", function () {
// IP2 is registered as IP1's derivative
const user1ConnectedLicensingModule= this.licensingModule.connect(signers[1]);
const registerDerivativeTx = await expect(
user1ConnectedLicensingModule.registerDerivative(ipId2, [ipId1], [this.nonCommericialLicenseId], PILicenseTemplate, hre.ethers.ZeroAddress, 0, 10, 50 * 10 ** 6)
user1ConnectedLicensingModule.registerDerivative(ipId2, [ipId1], [this.nonCommercialLicenseId], PILicenseTemplate, hre.ethers.ZeroAddress, 0, 10, 50 * 10 ** 6)
).to.be.rejectedWith(`execution reverted`);
});

Expand All @@ -67,7 +67,7 @@ describe("LicensingModule - registerDerivative", function () {

// IP2 attach a non-commercial license
const attachLicenseTx = await expect(
user1ConnectedLicensingModule.attachLicenseTerms(ipId2, PILicenseTemplate, this.nonCommericialLicenseId)
user1ConnectedLicensingModule.attachLicenseTerms(ipId2, PILicenseTemplate, this.nonCommercialLicenseId)
).not.to.be.rejectedWith(Error);
await attachLicenseTx.wait();
console.log("Attach license transaction hash: ", attachLicenseTx.hash);
Expand Down
2 changes: 1 addition & 1 deletion test/hardhat/e2e/royalty/royalty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("RoyaltyModule", function () {
// Get the signers
signers = await hre.ethers.getSigners();

// Register a commericial remix license with royalty policy LAP
// Register a commercial remix license with royalty policy LAP
testTerms.royaltyPolicy = RoyaltyPolicyLAP;
testTerms.defaultMintingFee = 100;
testTerms.commercialUse = true;
Expand Down
12 changes: 6 additions & 6 deletions test/hardhat/e2e/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ before(async function () {

console.log(`================= Register non-commercial PIL license terms =================`);
await this.licenseTemplate.registerLicenseTerms(terms).then((tx : any) => tx.wait());
this.nonCommericialLicenseId = await this.licenseTemplate.getLicenseTermsId(terms);
console.log("Non-commercial licenseTermsId: ", this.nonCommericialLicenseId);
this.nonCommercialLicenseId = await this.licenseTemplate.getLicenseTermsId(terms);
console.log("Non-commercial licenseTermsId: ", this.nonCommercialLicenseId);

console.log(`================= Register commercial-use PIL license terms =================`);
let testTerms = terms;
Expand All @@ -48,8 +48,8 @@ before(async function () {
testTerms.commercialUse = true;
testTerms.currency = MockERC20;
await this.licenseTemplate.registerLicenseTerms(testTerms).then((tx : any) => tx.wait());
this.commericialUseLicenseId = await this.licenseTemplate.getLicenseTermsId(testTerms);
console.log("Commercial-use licenseTermsId: ", this.commericialUseLicenseId);
this.commercialUseLicenseId = await this.licenseTemplate.getLicenseTermsId(testTerms);
console.log("Commercial-use licenseTermsId: ", this.commercialUseLicenseId);

console.log(`================= Register commercial-remix PIL license terms =================`);
testTerms = terms;
Expand All @@ -59,8 +59,8 @@ before(async function () {
testTerms.commercialRevShare = 100;
testTerms.currency = MockERC20;
await this.licenseTemplate.registerLicenseTerms(testTerms).then((tx : any) => tx.wait());
this.commericialRemixLicenseId = await this.licenseTemplate.getLicenseTermsId(testTerms);
console.log("Commercial-remix licenseTermsId: ", this.commericialRemixLicenseId);
this.commercialRemixLicenseId = await this.licenseTemplate.getLicenseTermsId(testTerms);
console.log("Commercial-remix licenseTermsId: ", this.commercialRemixLicenseId);

console.log(`================= ERC20 approve spender =================`);
const amountToCheck = BigInt(1 * 10 ** 18);
Expand Down

0 comments on commit ee30963

Please sign in to comment.