ERC20Mintable.test.js 873 B

123456789101112131415161718192021222324
  1. const { accounts, contract } = require('@openzeppelin/test-environment');
  2. const { shouldBehaveLikeERC20Mintable } = require('./behaviors/ERC20Mintable.behavior');
  3. const ERC20MintableMock = contract.fromArtifact('ERC20MintableMock');
  4. const { shouldBehaveLikePublicRole } = require('../../behaviors/access/roles/PublicRole.behavior');
  5. describe('ERC20Mintable', function () {
  6. const [ minter, otherMinter, ...otherAccounts ] = accounts;
  7. beforeEach(async function () {
  8. this.token = await ERC20MintableMock.new({ from: minter });
  9. });
  10. describe('minter role', function () {
  11. beforeEach(async function () {
  12. this.contract = this.token;
  13. await this.contract.addMinter(otherMinter, { from: minter });
  14. });
  15. shouldBehaveLikePublicRole(minter, otherMinter, otherAccounts, 'minter');
  16. });
  17. shouldBehaveLikeERC20Mintable(minter, otherAccounts);
  18. });