Merge tag 'v2.1.1' of github.com:OpenZeppelin/openzeppelin-solidity
v2.1.1
This commit is contained in:
@ -1,22 +1,17 @@
|
||||
const { assertRevert } = require('../helpers/assertRevert');
|
||||
const shouldFail = require('../helpers/shouldFail');
|
||||
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||
|
||||
const ERC20Mock = artifacts.require('ERC20Mock');
|
||||
const ERC20Mintable = artifacts.require('ERC20MintableMock');
|
||||
const ERC20Migrator = artifacts.require('ERC20MigratorMock');
|
||||
|
||||
const BigNumber = web3.eth.BigNumber;
|
||||
|
||||
require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
require('../helpers/setup');
|
||||
|
||||
contract('ERC20Migrator', function ([_, owner, recipient, anotherAccount]) {
|
||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
||||
|
||||
const totalSupply = 200;
|
||||
|
||||
it('reverts with a null legacy token address', async function () {
|
||||
await assertRevert(ERC20Migrator.new(ZERO_ADDRESS));
|
||||
await shouldFail.reverting(ERC20Migrator.new(ZERO_ADDRESS));
|
||||
});
|
||||
|
||||
describe('with tokens and migrator', function () {
|
||||
@ -32,11 +27,11 @@ contract('ERC20Migrator', function ([_, owner, recipient, anotherAccount]) {
|
||||
|
||||
describe('beginMigration', function () {
|
||||
it('reverts with a null new token address', async function () {
|
||||
await assertRevert(this.migrator.beginMigration(ZERO_ADDRESS));
|
||||
await shouldFail.reverting(this.migrator.beginMigration(ZERO_ADDRESS));
|
||||
});
|
||||
|
||||
it('reverts if not a minter of the token', async function () {
|
||||
await assertRevert(this.migrator.beginMigration(this.newToken.address));
|
||||
await shouldFail.reverting(this.migrator.beginMigration(this.newToken.address));
|
||||
});
|
||||
|
||||
it('succeeds if it is a minter of the token', async function () {
|
||||
@ -47,7 +42,7 @@ contract('ERC20Migrator', function ([_, owner, recipient, anotherAccount]) {
|
||||
it('reverts the second time it is called', async function () {
|
||||
await this.newToken.addMinter(this.migrator.address);
|
||||
await this.migrator.beginMigration(this.newToken.address);
|
||||
await assertRevert(this.migrator.beginMigration(this.newToken.address));
|
||||
await shouldFail.reverting(this.migrator.beginMigration(this.newToken.address));
|
||||
});
|
||||
});
|
||||
|
||||
@ -147,7 +142,7 @@ contract('ERC20Migrator', function ([_, owner, recipient, anotherAccount]) {
|
||||
const amount = baseAmount + 1;
|
||||
|
||||
it('reverts', async function () {
|
||||
await assertRevert(this.migrator.migrate(owner, amount));
|
||||
await shouldFail.reverting(this.migrator.migrate(owner, amount));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user