Improve error messages for ERC721 and 1155 (#3254)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
Kata
2022-05-27 02:52:43 +02:00
committed by GitHub
parent 61294a62af
commit 488dd562fb
8 changed files with 16 additions and 15 deletions

View File

@ -192,7 +192,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another
it('reverts', async function () {
await expectRevert(
transferFunction.call(this, owner, other, tokenId, { from: other }),
'ERC721: transfer caller is not owner nor approved',
'ERC721: caller is not token owner nor approved',
);
});
});
@ -509,7 +509,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another
context('when the sender does not own the given token ID', function () {
it('reverts', async function () {
await expectRevert(this.token.approve(approved, tokenId, { from: other }),
'ERC721: approve caller is not owner nor approved');
'ERC721: approve caller is not token owner nor approved');
});
});
@ -517,7 +517,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another
it('reverts', async function () {
await this.token.approve(approved, tokenId, { from: owner });
await expectRevert(this.token.approve(anotherApproved, tokenId, { from: approved }),
'ERC721: approve caller is not owner nor approved for all');
'ERC721: approve caller is not token owner nor approved for all');
});
});