diff --git a/contracts/mocks/SimpleCaller.sol b/contracts/mocks/SimpleCaller.sol index 823cf87c..5758a6e4 100644 --- a/contracts/mocks/SimpleCaller.sol +++ b/contracts/mocks/SimpleCaller.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.0; contract SimpleCaller { - // event SimpleCallerCalled(address target); /** * @dev Calls a function of another contract. * @param target The address of the target contract. @@ -15,7 +14,6 @@ contract SimpleCaller { (bool success, bytes memory result) = target.call{ value: msg.value }(data); require(success, "Function call failed"); - // emit SimpleCallerCalled(target); return result; } } diff --git a/contracts/mocks/TradeTrustTokenMock.sol b/contracts/mocks/TradeTrustTokenMock.sol index fc60d337..52aa29df 100644 --- a/contracts/mocks/TradeTrustTokenMock.sol +++ b/contracts/mocks/TradeTrustTokenMock.sol @@ -4,8 +4,6 @@ pragma solidity ^0.8.0; import "../TradeTrustToken.sol"; contract TradeTrustTokenMock is TradeTrustToken { - // mapping(uint256 => address) private _owners; // Declare the _owners mapping - constructor( string memory name, string memory symbol, @@ -14,7 +12,7 @@ contract TradeTrustTokenMock is TradeTrustToken { function mintInternal(address to, uint256 tokenId) public virtual onlyRole(MINTER_ROLE) returns (bool) { _safeMint(to, tokenId); - return true; + return true; } function burnInternal(uint256 tokenId) public virtual { diff --git a/test/TitleEscrow.test.ts b/test/TitleEscrow.test.ts index 2a6029b9..d2b28132 100644 --- a/test/TitleEscrow.test.ts +++ b/test/TitleEscrow.test.ts @@ -26,10 +26,6 @@ import { impersonateAccount, TestUsers, } from "./helpers"; -// import createFakeRegistry from "../src/utils/fakes/fakeRegistry"; -// import { Provider } from "@ethersproject/abstract-provider"; -// import TradeTrustAbi from "../artifacts/contracts/TradeTrustToken.sol/TradeTrustToken.json"; -// import FakeRegistry from "./../contracts/fakes/fakeRegistry"; describe("Title Escrow", async () => { let users: TestUsers; @@ -143,9 +139,6 @@ describe("Title Escrow", async () => { let fakeRegistry: any; beforeEach(async () => { - // fakeRegistry = (await smock.fake("TradeTrustToken")) as FakeContract; - // fakeAddress = ethers.utils.getAddress(faker.finance.ethereumAddress()); - // using registry contract as fake registry, no special set state is needed for these tests fakeRegistry = registryContract; (fakeRegistry as any).wallet = await impersonateAccount({ @@ -184,11 +177,6 @@ describe("Title Escrow", async () => { ["address", "address"], [users.beneficiary.address, users.holder.address] ); - - // await users.carrier.sendTransaction({ - // to: fakeRegistry.address, - // value: ethers.utils.parseEther("0.1"), - // }); }); describe("Minting Token Receive", () => { diff --git a/test/TitleEscrowSignable.test.ts b/test/TitleEscrowSignable.test.ts index e41645a1..b73cd3b7 100644 --- a/test/TitleEscrowSignable.test.ts +++ b/test/TitleEscrowSignable.test.ts @@ -49,16 +49,6 @@ describe("TitleEscrowSignable", async () => { return [titleEscrowWithProxy]; }; - - // deployTokenFixtureRunner = async () => - // createDeployFixtureRunner( - // ...(await deployTokenFixture({ - // tokenContractName: "TradeTrustTokenMock", - // tokenName: registryName, - // tokenInitials: registrySymbol, - // deployer: users.carrier, - // })) - // ); }); beforeEach(async () => { @@ -170,11 +160,6 @@ describe("TitleEscrowSignable", async () => { await titleEscrowContract.initialize(fakeRegistryContract.address, fakeTokenId); - // await users.carrier.sendTransaction({ - // to: fakeRegistryContract.address, - // value: ethers.utils.parseEther("0.1"), - // }); - const data = new ethers.utils.AbiCoder().encode( ["address", "address"], [users.beneficiary.address, users.holder.address] @@ -222,9 +207,6 @@ describe("TitleEscrowSignable", async () => { describe("When title escrow is inactive", () => { beforeEach(async () => { - // fakeRegistryContract.ownerOf.returns(faker.finance.ethereumAddress()); - // await titleEscrowContract.connect(fakeRegistryContract.wallet as Signer).shred(); - await titleEscrowContract.connect(users.holder).transferHolder(users.beneficiary.address); await titleEscrowContract.connect(users.beneficiary).surrender(); await titleEscrowContract.connect(registrySigner as Signer).shred(); @@ -245,11 +227,8 @@ describe("TitleEscrowSignable", async () => { describe("When title escrow is not holding token", () => { beforeEach(async () => { - // fakeRegistryContract.ownerOf.returns(faker.finance.ethereumAddress()); - await titleEscrowContract.connect(users.holder).transferHolder(users.beneficiary.address); await titleEscrowContract.connect(users.beneficiary).surrender(); - // // await titleEscrowContract.connect(registrySigner as Signer).shred(); }); it("should revert when calling: transferBeneficiaryWithSig", async () => { diff --git a/test/TradeTrustTokenMintable.test.ts b/test/TradeTrustTokenMintable.test.ts index 6101cec3..61646c2c 100644 --- a/test/TradeTrustTokenMintable.test.ts +++ b/test/TradeTrustTokenMintable.test.ts @@ -33,9 +33,6 @@ describe("TradeTrustTokenMintable", async () => { registrySymbol = "GSC"; deployMockTitleEscrowAndTokenFixtureRunner = async () => { - // const mockTitleEscrowFactoryContractFixture = (await ( - // await smock.mock("TitleEscrowFactory", users.carrier) - // ).deploy()) as unknown as MockContract; const mockTitleEscrowFactoryContractFixture = (await ( await ethers.getContractFactory("TitleEscrowFactory") ).deploy()) as TitleEscrowFactory; diff --git a/test/fixtures/deploy-token.fixture.ts b/test/fixtures/deploy-token.fixture.ts index 84e6a85a..29758a04 100644 --- a/test/fixtures/deploy-token.fixture.ts +++ b/test/fixtures/deploy-token.fixture.ts @@ -9,8 +9,7 @@ export const deployTokenFixture = async ({ tokenInitials, deployer, escrowFactoryAddress = undefined, -}: // useMock = false, -{ +}: { tokenContractName: string; tokenName: string; tokenInitials: string; @@ -29,17 +28,9 @@ export const deployTokenFixture = async ({ } const tradeTrustTokenFactory = await ethers.getContractFactory(tokenContractName); - // const tradeTrustTokenContract: T; - - // if (useMock) { - // tradeTrustTokenContract = (await ( - // await smock.mock(tokenContractName, deployer) - // ).deploy(tokenName, tokenInitials, escrowFactoryAddress)) as unknown as T; - // } else { const tradeTrustTokenContract: T = (await tradeTrustTokenFactory .connect(deployer) .deploy(tokenName, tokenInitials, escrowFactoryAddress)) as T; - // } return [titleEscrowFactoryContract, tradeTrustTokenContract]; }; diff --git a/test/token/SBTUpgradeable.test.ts b/test/token/SBTUpgradeable.test.ts index 6d599334..6d33fc54 100644 --- a/test/token/SBTUpgradeable.test.ts +++ b/test/token/SBTUpgradeable.test.ts @@ -124,31 +124,11 @@ describe("SBTUpgradeable", async () => { await expect(mockSbtContract.safeMintWithDataInternal(erc721ReceiverContract.address, tokenId, data)) .to.emit(erc721ReceiverContract, "TokenReceived") .withArgs(users.beneficiary.address, users.holder.address, true, mockSbtContract.address, tokenId); - - // The following code (commented out) checks if the onERC721Received function was called with specific arguments. - // expect(erc721ReceiverContract.onERC721Received).to.have.been.calledWith( - // deployer.address, - // ethers.constants.AddressZero, - // tokenId, - // "0x1234" - // ); }); it("should call onERC721Received without data", async () => { - // The following code (commented out) was meant to test the minting process without additional data. - // It checks if onERC721Received was called with the expected arguments. - // await mockSbtContract.safeMintInternal(erc721ReceiverContract.address, tokenId); - // The expectation here is that calling safeMintInternal without data should revert. await expect(mockSbtContract.safeMintInternal(erc721ReceiverContract.address, tokenId)).to.be.reverted; - - // The following code (commented out) checks if the onERC721Received function was called with specific arguments. This test won't work with our solidity mock contracts. - // expect(erc721ReceiverContract.onERC721Received).to.have.been.calledWith( - // deployer.address, - // ethers.constants.AddressZero, - // tokenId, - // "0x" - // ); }); it("should revert with standard reason when onERC721Received reverts without reason", async () => { @@ -322,7 +302,6 @@ describe("SBTUpgradeable", async () => { }); it("should revert when transferring to a non ERC721Receiver implementer", async () => { - // erc721ReceiverContract.onERC721Received.returns("0x1234"); const fakeAddress = ethers.Wallet.createRandom().address; // Define fake bytecode (e.g., simple contract that returns true on `isContract` call) const fakeCode = "0x60006000"; // Minimal example, real contract code would be more complex