Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d9093d5
Started updating SubReg test. Changed rootDomains registration to reg…
MichaelKorchagin Jul 4, 2025
1623b21
Subregistrar tests optimization
MichaelKorchagin Aug 1, 2025
6b18561
More test fixes according to domain registration. Changed executor if…
MichaelKorchagin Aug 6, 2025
5f08a2b
Test fixes. Corrected approval for a domain in the Domain class.
MichaelKorchagin Aug 7, 2025
233748d
More registration fixes.
MichaelKorchagin Aug 7, 2025
3ddc55d
Done with all bulk registration tests. Started "Operations with domai…
MichaelKorchagin Aug 12, 2025
540d2dc
Fails fixes for first tests in "Operations with domain paths"
MichaelKorchagin Aug 19, 2025
fff89ac
2nd describe test fixes
MichaelKorchagin Aug 21, 2025
b728da0
Added a couple of getters from the class and one setter for payment t…
MichaelKorchagin Aug 22, 2025
cd0398e
Redundant checks removal in "Single Subdomain Registration"
MichaelKorchagin Aug 22, 2025
3cbdd97
Added passing parameters by objects in the Domain class
MichaelKorchagin Aug 22, 2025
25bbfef
Getters have been moved to the appropriate location. More subregistra…
MichaelKorchagin Aug 26, 2025
17954d6
Test failing fix
MichaelKorchagin Aug 26, 2025
0eb739b
RootReg test minor fixes
MichaelKorchagin Sep 16, 2025
f26aa62
Merge branch 'development' into domain-helper-128-duplicate
MichaelKorchagin Sep 17, 2025
a7918ab
Moved most part of unit tests to separate module. Updated proccess. […
MichaelKorchagin Sep 19, 2025
985885a
Moved more unit tests to appropriated module. Corrected order of test…
MichaelKorchagin Sep 30, 2025
1b138e8
Minor test fix
MichaelKorchagin Sep 30, 2025
c03901e
Tests type fixes
MichaelKorchagin Sep 30, 2025
c9c4b6d
Merge branch 'test/domain-helper-class-128' into domain-helper-128-du…
MichaelKorchagin Sep 30, 2025
05a0410
After merge fixes
MichaelKorchagin Sep 30, 2025
07349e7
Updated Domain class functions to work with object params. Updated tests
MichaelKorchagin Sep 30, 2025
5eb6ebc
Test fixes in accordance with new domain methods.
MichaelKorchagin Oct 1, 2025
4724d7e
More tests updated in accordance of Domain class changes.
MichaelKorchagin Oct 2, 2025
2511f14
Minor Domain class fixes
MichaelKorchagin Oct 3, 2025
e467e06
Linter fixes.
MichaelKorchagin Oct 3, 2025
c0545bc
Merge branch 'development' into domain-helper-128-duplicate
MichaelKorchagin Oct 6, 2025
fbc4468
Fixes based on Copilot's review
MichaelKorchagin Oct 7, 2025
47c8a50
CI check
MichaelKorchagin Oct 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions test/DeployCampaignInt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import { getConfig } from "../src/deploy/campaign/get-config";
import { ethers } from "ethers";
import { promisify } from "util";
import { exec } from "child_process";
import { saveTag } from "../src/utils/git-tag/save-tag";
import { IZNSCampaignConfig, IZNSContracts } from "../src/deploy/campaign/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { getZnsMongoAdapter } from "../src/deploy/mongo";
Expand Down Expand Up @@ -943,8 +942,6 @@ describe("Deploy Campaign Test", () => {
>;

before(async () => {
await saveTag();

campaignConfig = {
env,
confirmationsN: 0,
Expand Down
5 changes: 4 additions & 1 deletion test/ZNSAddressResolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ describe("ZNSAddressResolver", () => {
});

it("Should allow operator to setAddress and emit event", async () => {
await domain.setOwnersOperator(operator.address, true);
await domain.setOwnersOperator({
operator: operator.address,
allowed: true,
});

await expect(
zns.addressResolver.connect(operator)
Expand Down
81 changes: 51 additions & 30 deletions test/ZNSRootRegistrar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ describe("ZNSRootRegistrar", () => {
});
await domain.register();

await domain.updateMintlistForDomain(
await domain.updateMintlistForDomain({
candidates,
allowed
);
allowed,
});
});

it("Should NOT initialize the implementation contract", async () => {
Expand Down Expand Up @@ -422,7 +422,7 @@ describe("ZNSRootRegistrar", () => {
};

const domain = new Domain(args);
await domain.registerAndValidateDomain();
await domain.registerAndValidateDomain({});
}
});

Expand Down Expand Up @@ -477,7 +477,7 @@ describe("ZNSRootRegistrar", () => {
label: defaultDomain,
},
});
await domain.registerAndValidateDomain();
await domain.registerAndValidateDomain({});

await zns.rootRegistrar.connect(admin).unpauseRegistration();
});
Expand All @@ -493,7 +493,7 @@ describe("ZNSRootRegistrar", () => {
},
});

await domain.registerAndValidateDomain();
await domain.registerAndValidateDomain({});
});

it("Successfully registers a domain with distrConfig and adds it to state properly", async () => {
Expand All @@ -514,13 +514,13 @@ describe("ZNSRootRegistrar", () => {
},
});

await domain.registerAndValidateDomain();
await domain.registerAndValidateDomain({});

const {
pricerContract,
accessType,
paymentType,
} = await zns.subRegistrar.distrConfigs(domain.hash);
} = await domain.getDistributionConfig();

expect(pricerContract).to.eq(distrConfig.pricerContract);
expect(paymentType).to.eq(distrConfig.paymentType);
Expand All @@ -537,7 +537,7 @@ describe("ZNSRootRegistrar", () => {
tokenURI,
},
});
await domain.registerAndValidateDomain(randomUser);
await domain.registerAndValidateDomain({ executor: randomUser });

expect(await domain.ownerOfToken).to.eq(randomUser.address);
});
Expand Down Expand Up @@ -718,7 +718,7 @@ describe("ZNSRootRegistrar", () => {
},
});
// validates in Registry and events
await domain.registerAndValidateDomain();
await domain.registerAndValidateDomain({});

const namehashRef = hashDomainLabel(defaultDomain);

Expand Down Expand Up @@ -930,7 +930,10 @@ describe("ZNSRootRegistrar", () => {
expect(await domain.ownerOfHash).to.equal(user.address);

// Reclaim the Domain Token
await domain.assignDomainToken(user.address, user);
await domain.assignDomainToken({
to: user.address,
executor: user,
});

// Verify domain token is now owned by new hash owner
expect(await domain.ownerOfToken).to.equal(user.address);
Expand All @@ -957,7 +960,10 @@ describe("ZNSRootRegistrar", () => {

// Assign the Domain token
await expect(
domain.assignDomainToken(user.address, deployer)
domain.assignDomainToken({
to: user.address,
executor: deployer,
})
).to.emit(zns.rootRegistrar, "DomainTokenReassigned").withArgs(
domain.hash,
user.address
Expand All @@ -977,7 +983,10 @@ describe("ZNSRootRegistrar", () => {

// Reclaim the Domain
await expect(
domain.assignDomainToken(user.address, user)
domain.assignDomainToken({
to: user.address,
executor: user,
})
).to.be.revertedWithCustomError(
zns.rootRegistrar,
NOT_AUTHORIZED_ERR,
Expand Down Expand Up @@ -1019,7 +1028,10 @@ describe("ZNSRootRegistrar", () => {
await zns.registry.connect(deployer).updateDomainOwner(domain.hash, user.address);

// Claim the Domain token
await domain.assignDomainToken(user.address, user);
await domain.assignDomainToken({
to: user.address,
executor: user,
});
// Verify domain token is owned
expect(await domain.ownerOfToken).to.equal(user.address);

Expand All @@ -1031,7 +1043,10 @@ describe("ZNSRootRegistrar", () => {
expect(await domain.ownerOfHash).to.equal(deployer.address);

// Assign the Domain token to diff address again
await domain.assignDomainToken(user.address, deployer);
await domain.assignDomainToken({
to: user.address,
executor: deployer,
});

// Verify domain token is owned
expect(await domain.ownerOfToken).to.equal(user.address);
Expand All @@ -1058,7 +1073,7 @@ describe("ZNSRootRegistrar", () => {

// Assign the Domain token
await expect(
domain.assignDomainToken(deployer.address)
domain.assignDomainToken({ to: deployer.address })
).to.be.revertedWithCustomError(
zns.rootRegistrar,
"AlreadyTokenOwner",
Expand Down Expand Up @@ -1206,11 +1221,11 @@ describe("ZNSRootRegistrar", () => {
await domain.register();

// add mintlist to check revocation
await domain.updateMintlistForDomain(
[user.address, zeroVault.address],
[true, true],
user
);
await domain.updateMintlistForDomain({
candidates: [user.address, zeroVault.address],
allowed: [true, true],
executor: user,
});

const ogPrice = BigInt(135);

Expand All @@ -1221,10 +1236,10 @@ describe("ZNSRootRegistrar", () => {

const asBytes = encodePriceConfig(newConfig);

await domain.setPricerDataForDomain(
newConfig,
zns.fixedPricer.target,
);
await domain.setPricerDataForDomain({
priceConfig: newConfig,
pricerContract: zns.fixedPricer.target,
});

expect(await zns.fixedPricer.getPrice(asBytes, defaultDomain, false)).to.eq(ogPrice);

Expand All @@ -1244,12 +1259,12 @@ describe("ZNSRootRegistrar", () => {
expect(exists).to.be.false;

// validate access type has been set to LOCKED
const { accessType } = await zns.subRegistrar.distrConfigs(domain.hash);
const { accessType } = await domain.getDistributionConfig();
expect(accessType).to.eq(AccessType.LOCKED);

// validate mintlist has been removed
expect(await zns.subRegistrar.isMintlistedForDomain(domain.hash, user.address)).to.be.false;
expect(await zns.subRegistrar.isMintlistedForDomain(domain.hash, zeroVault.address)).to.be.false;
expect(await domain.isMintlistedForDomain(user)).to.be.false;
expect(await domain.isMintlistedForDomain(zeroVault)).to.be.false;
});

it("Cannot revoke a domain that doesnt exist", async () => {
Expand Down Expand Up @@ -1347,7 +1362,10 @@ describe("ZNSRootRegistrar", () => {
await domain.ownerOfHash
).to.not.equal(user.address);

await domain.assignDomainToken(user.address, deployer);
await domain.assignDomainToken({
to: user.address,
executor: deployer,
});

// Try to revoke domain as a new owner of the token
await expect(
Expand All @@ -1374,7 +1392,10 @@ describe("ZNSRootRegistrar", () => {
await domain.register();

// assign an operator
await domain.setOwnersOperator(operator.address, true);
await domain.setOwnersOperator({
operator: operator.address,
allowed: true,
});

// Revoke the domain
await domain.revoke();
Expand Down
Loading