provide 'automatic' token URI by appending the token ID to the base URI (#2174)

* provide 'automatic' token URI by appending the token ID to the base URI, if a base is set but no token-specific URI is available

* make the three cases more explicit, avoid else after return

* adjust comments to reflect reality
This commit is contained in:
Robert Kaiser
2020-04-15 20:39:33 +02:00
committed by GitHub
parent 4ca719bf8b
commit b6513f6ad7
2 changed files with 18 additions and 12 deletions

View File

@ -92,10 +92,10 @@ describe('ERC721', function () {
expect(await this.token.tokenURI(firstTokenId)).to.be.equal(newBaseURI + sampleUri);
});
it('token URI is empty for tokens with no URI but with base URI', async function () {
it('tokenId is appended to base URI for tokens with no URI', async function () {
await this.token.setBaseURI(baseURI);
expect(await this.token.tokenURI(firstTokenId)).to.be.equal('');
expect(await this.token.tokenURI(firstTokenId)).to.be.equal(baseURI + firstTokenId);
});
it('tokens with URI can be burnt ', async function () {