Skip to content

Commit

Permalink
test: add more tests for ERC725 to ensure it supports both X and Y …
Browse files Browse the repository at this point in the history
…interfaces
  • Loading branch information
CJ42 committed Sep 8, 2024
1 parent 2012cd2 commit 4acb584
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
22 changes: 21 additions & 1 deletion implementations/test/ERC725.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ describe('ERC725', () => {

expect(await ethers.provider.getBalance(contract.address)).to.equal(deployParams.funding);
});

it('should have registered the ERC725X & ERC725Y interfaces', async () => {
const accounts = await ethers.getSigners();

const deployParams = {
newOwner: accounts[0].address,
funding: ethers.utils.parseEther('10'),
};

const contract = await new ERC725__factory(accounts[0]).deploy(deployParams.newOwner, {
value: deployParams.funding,
});

expect(await contract.supportsInterface(INTERFACE_ID.ERC725X)).to.be.true;
expect(await contract.supportsInterface(INTERFACE_ID.ERC725X)).to.be.true;
});
});
});

Expand Down Expand Up @@ -105,7 +121,11 @@ describe('ERC725', () => {
});

it('should have registered the ERC725X interface', async () => {
expect(await context.erc725.supportsInterface(INTERFACE_ID.ERC725X));
expect(await context.erc725.supportsInterface(INTERFACE_ID.ERC725X)).to.be.true;
});

it('should have registered the ERC725Y interface', async () => {
expect(await context.erc725.supportsInterface(INTERFACE_ID.ERC725Y)).to.be.true;
});

it('should revert when initializing with address(0) as owner', async () => {
Expand Down
2 changes: 1 addition & 1 deletion implementations/test/ERC725X.behaviour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,7 @@ export const shouldInitializeLikeERC725X = (
});

it('should have registered the ERC725X interface', async () => {
expect(await context.erc725X.supportsInterface(INTERFACE_ID.ERC725X));
expect(await context.erc725X.supportsInterface(INTERFACE_ID.ERC725X)).to.be.true;
});

it('should have set the correct owner', async () => {
Expand Down
2 changes: 1 addition & 1 deletion implementations/test/ERC725Y.behaviour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ export const shouldInitializeLikeERC725Y = (
});

it('should have registered the ERC725Y interface', async () => {
expect(await context.erc725Y.supportsInterface(INTERFACE_ID.ERC725Y));
expect(await context.erc725Y.supportsInterface(INTERFACE_ID.ERC725Y)).to.be.true;
});
});
};

0 comments on commit 4acb584

Please sign in to comment.