* Extract standard token behaviuor to reuse it in other tests * Add opt in ERC20 migration contract * Make migration contract not to depend from standard token * Changes based on feedback * Improve MigratableERC20 inline documentation * move behaviors to behaviors directory * refactor MigratableERC20 into ERC20Migrator * fix errors * change expectEvent to support multiple events with same name * fix tests * update documentation * rename MigratableERC20 files to ERC20Migrator * move to drafts * test beginMigration * rename to ERC20Migrator * missing semicolon (╯°□°)╯︵ ┻━┻ * add non-zero check * improve documentation based on review comments * improve test descriptions * improve docs * add getters * fix contract * improve tests
26 lines
857 B
JavaScript
26 lines
857 B
JavaScript
const { assertRevert } = require('../../helpers/assertRevert');
|
|
const { ether } = require('../../helpers/ether');
|
|
const { shouldBehaveLikeERC20Mintable } = require('./behaviors/ERC20Mintable.behavior');
|
|
const { shouldBehaveLikeERC20Capped } = require('./behaviors/ERC20Capped.behavior');
|
|
|
|
const ERC20Capped = artifacts.require('ERC20Capped');
|
|
|
|
contract('ERC20Capped', function ([_, minter, ...otherAccounts]) {
|
|
const cap = ether(1000);
|
|
|
|
it('requires a non-zero cap', async function () {
|
|
await assertRevert(
|
|
ERC20Capped.new(0, { from: minter })
|
|
);
|
|
});
|
|
|
|
context('once deployed', async function () {
|
|
beforeEach(async function () {
|
|
this.token = await ERC20Capped.new(cap, { from: minter });
|
|
});
|
|
|
|
shouldBehaveLikeERC20Capped(minter, otherAccounts, cap);
|
|
shouldBehaveLikeERC20Mintable(minter, otherAccounts);
|
|
});
|
|
});
|