-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getApproved require the given token ID exist #1256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch @lamengao, thanks!
it('clears the approval', async function () { | ||
(await this.token.getApproved(tokenId)).should.be.equal(ZERO_ADDRESS); | ||
context('when the token ID does not exist', function () { | ||
it('reverts', async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the current phrasing a bit confusing: maybe we could merge the context
and it
blocks, and change the description to something like 'causes getApproved to revert'?
We also may want to add a test block for getApproved
, explicitly checking for this, though that could be considered part of #1148.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Description
In the ERC-721 standard the
getApproved
comment mentioned "Throws if_tokenId
is not a valid NFT".This PR make
getApproved
conforms to ERC721 standard in better terms.npm run lint:all:fix
).