diff --git a/test/Gov.ts b/test/Gov.ts index 0e3625d..041bd59 100644 --- a/test/Gov.ts +++ b/test/Gov.ts @@ -87,7 +87,7 @@ describe("Gov", function () { const erc1155Mock = await ERC1155Mock.deploy(); await erc1155Mock.safeTransferFrom(deployer.address, gov.address, 1, 1, "0x") - return { gov, nft, deployer, alice, bob, francis, erc20Mock, erc721Mock, erc1155Mock, signers, amount, quorum } + return { gov, nft, deployer, alice, bob, francis, erc20Mock, erc721Mock, erc1155Mock, signers, amount, quorum, firstMembers } } describe("Deployment", function () { @@ -711,40 +711,8 @@ describe("Gov", function () { }) it("Should not transfer the membership NFT", async function () { - const { gov, nft, alice, francis, bob, erc721Mock } = await loadFixture(deployContracts); - - expect (await nft.ownerOf(0)).to.be.equal(alice.address) - // await nft.connect(alice).transferFrom(alice.address, bob.address, 0) - // // expect (nft.connect(alice).transferFrom(alice.address, bob.address, 0)).to.be.revertedWith("Token not transferable") - - // return - const erc721Transfer = erc721Mock.interface.encodeFunctionData('transferFrom', [gov.address, francis.address, 1]) - const calldatas = [erc721Transfer.toString()] - - - const PROPOSAL_DESCRIPTION = "" - const targets = [erc721Mock.address] - const values = ["0"] - const propose = await gov.connect(alice).propose( - targets, - values, - calldatas, - PROPOSAL_DESCRIPTION - ) - const proposeReceipt = await propose.wait(1) - const proposalId = proposeReceipt.events![0].args!.proposalId.toString() - await moveBlocks(2) - await gov.connect(alice).castVote(proposalId,1) - await gov.connect(bob).castVote(proposalId,1) - await moveBlocks(300) - const desc = ethers.utils.id(PROPOSAL_DESCRIPTION) - await gov.execute( - targets, - values, - calldatas, - desc - ) - expect(await erc721Mock.ownerOf(1)).to.equal(francis.address); + const { nft, alice, bob } = await loadFixture(deployContracts); + await expect(nft.transferFrom(bob.address, alice.address, 1)).to.be.revertedWith("ERC721: caller is not token owner or approved") }); }) })