Add IERC4906 interface and use in ERC721 (#4012)

Co-authored-by: Francisco Giordano <fg@frang.io>
This commit is contained in:
Hadrien Croubois
2023-02-17 10:26:10 +01:00
committed by GitHub
parent d64d7aa5d1
commit 96a2297e15
5 changed files with 42 additions and 2 deletions

View File

@ -1,4 +1,4 @@
const { BN, expectRevert } = require('@openzeppelin/test-helpers');
const { BN, expectEvent, expectRevert } = require('@openzeppelin/test-helpers');
const { expect } = require('chai');
@ -38,6 +38,12 @@ contract('ERC721URIStorage', function (accounts) {
expect(await this.token.tokenURI(firstTokenId)).to.be.equal(sampleUri);
});
it('setting the uri emits an event', async function () {
expectEvent(await this.token.$_setTokenURI(firstTokenId, sampleUri), 'MetadataUpdate', {
_tokenId: firstTokenId,
});
});
it('reverts when setting for non existent token id', async function () {
await expectRevert(
this.token.$_setTokenURI(nonExistentTokenId, sampleUri),