Add ERC20 _setTokenURI (#1618)

* Add _setTokenURI internal.

* Rename TokenMetadata to ERC20Metadata.

* Add changelog entry for ERC20Metadata.

* Fix linter error.

* Add breaking change changelog notice.
This commit is contained in:
Nicolás Venturo
2019-01-25 15:16:19 -03:00
committed by Francisco Giordano
parent 1fd993bc01
commit 8dd92fd6ca
6 changed files with 46 additions and 32 deletions

View File

@ -0,0 +1,23 @@
require('openzeppelin-test-helpers');
const ERC20MetadataMock = artifacts.require('ERC20MetadataMock');
const metadataURI = 'https://example.com';
describe('ERC20Metadata', function () {
beforeEach(async function () {
this.token = await ERC20MetadataMock.new(metadataURI);
});
it('responds with the metadata', async function () {
(await this.token.tokenURI()).should.equal(metadataURI);
});
describe('setTokenURI', function () {
it('changes the original URI', async function () {
const newMetadataURI = 'https://betterexample.com';
await this.token.setTokenURI(newMetadataURI);
(await this.token.tokenURI()).should.equal(newMetadataURI);
});
});
});

View File

@ -1,15 +0,0 @@
require('openzeppelin-test-helpers');
const ERC20WithMetadataMock = artifacts.require('ERC20WithMetadataMock');
const metadataURI = 'https://example.com';
describe('ERC20WithMetadata', function () {
beforeEach(async function () {
this.token = await ERC20WithMetadataMock.new(metadataURI);
});
it('responds with the metadata', async function () {
(await this.token.tokenURI()).should.equal(metadataURI);
});
});