Improve error messages for ERC721 and 1155 (#3254)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -293,7 +293,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder,
|
||||
this.token.safeTransferFrom(multiTokenHolder, recipient, firstTokenId, firstAmount, '0x', {
|
||||
from: proxy,
|
||||
}),
|
||||
'ERC1155: caller is not owner nor approved',
|
||||
'ERC1155: caller is not token owner nor approved',
|
||||
);
|
||||
});
|
||||
});
|
||||
@ -569,7 +569,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder,
|
||||
[firstAmount, secondAmount],
|
||||
'0x', { from: proxy },
|
||||
),
|
||||
'ERC1155: transfer caller is not owner nor approved',
|
||||
'ERC1155: caller is not token owner nor approved',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -36,7 +36,7 @@ contract('ERC1155Burnable', function (accounts) {
|
||||
it('unapproved accounts cannot burn the holder\'s tokens', async function () {
|
||||
await expectRevert(
|
||||
this.token.burn(holder, tokenIds[0], amounts[0].subn(1), { from: other }),
|
||||
'ERC1155: caller is not owner nor approved',
|
||||
'ERC1155: caller is not token owner nor approved',
|
||||
);
|
||||
});
|
||||
});
|
||||
@ -60,7 +60,7 @@ contract('ERC1155Burnable', function (accounts) {
|
||||
it('unapproved accounts cannot burn the holder\'s tokens', async function () {
|
||||
await expectRevert(
|
||||
this.token.burnBatch(holder, tokenIds, [ amounts[0].subn(1), amounts[1].subn(2) ], { from: other }),
|
||||
'ERC1155: caller is not owner nor approved',
|
||||
'ERC1155: caller is not token owner nor approved',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user