-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add _setTokenURI internal. * Rename TokenMetadata to ERC20Metadata. * Add changelog entry for ERC20Metadata. * Fix linter error. * Add breaking change changelog notice.
- Loading branch information
Showing
6 changed files
with
46 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pragma solidity ^0.5.2; | ||
|
||
import "../token/ERC20/ERC20.sol"; | ||
import "../drafts/ERC1046/ERC20Metadata.sol"; | ||
|
||
contract ERC20MetadataMock is ERC20, ERC20Metadata { | ||
constructor (string memory tokenURI) public ERC20Metadata(tokenURI) { | ||
// solhint-disable-previous-line no-empty-blocks | ||
} | ||
|
||
function setTokenURI(string memory tokenURI) public { | ||
_setTokenURI(tokenURI); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.