Lesson 15: marketplace test #1217
Unanswered
CodeLikeLisa
asked this question in
Q&A
Replies: 1 comment
-
From my understanding, Its to ensure that it gets reverted, if someone tried to list an improperly approved token. As well as, it bumps up those coverage numbers. something like: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Not sure I understand the logic behind this line
await basicNft.approve(ethers.constants.AddressZero, TOKEN_ID)
in the code below... namely why this "ethers.constants.AddressZero" is necessary or the logic behind it as I would thinkawait basicNft.approve(NftMarketplacecontract.address, TOKEN_ID)
would be the way to deal with thisit("needs approvals to list item", async function () {
await basicNft.approve(ethers.constants.AddressZero, TOKEN_ID)
await expect(
nftMarketplace.listItem(basicNft.address, TOKEN_ID, PRICE)
).to.be.revertedWith("NotApprovedForMarketplace")
})
Beta Was this translation helpful? Give feedback.
All reactions