adapt contracts for upgradeability
This commit is contained in:
@ -8,6 +8,7 @@ contract('Ownable', function (accounts) {
|
||||
|
||||
beforeEach(async function () {
|
||||
ownable = await Ownable.new();
|
||||
await ownable.initialize(accounts[0]);
|
||||
});
|
||||
|
||||
it('should have an owner', async function () {
|
||||
|
||||
@ -3,7 +3,8 @@ const MintableToken = artifacts.require('MintableToken');
|
||||
|
||||
contract('Mintable', function ([owner, anotherAccount]) {
|
||||
beforeEach(async function () {
|
||||
this.token = await MintableToken.new({ from: owner });
|
||||
this.token = await MintableToken.new();
|
||||
await this.token.initialize(owner);
|
||||
});
|
||||
|
||||
describe('minting finished', function () {
|
||||
|
||||
@ -15,9 +15,11 @@ contract('TokenTimelock', function ([_, owner, beneficiary]) {
|
||||
const amount = new BigNumber(100);
|
||||
|
||||
beforeEach(async function () {
|
||||
this.token = await MintableToken.new({ from: owner });
|
||||
this.token = await MintableToken.new();
|
||||
await this.token.initialize(owner);
|
||||
this.releaseTime = latestTime() + duration.years(1);
|
||||
this.timelock = await TokenTimelock.new(this.token.address, beneficiary, this.releaseTime);
|
||||
this.timelock = await TokenTimelock.new();
|
||||
await this.timelock.initialize(this.token.address, beneficiary, this.releaseTime);
|
||||
await this.token.mint(this.timelock.address, amount, { from: owner });
|
||||
});
|
||||
|
||||
|
||||
@ -16,13 +16,15 @@ contract('TokenVesting', function ([_, owner, beneficiary]) {
|
||||
const amount = new BigNumber(1000);
|
||||
|
||||
beforeEach(async function () {
|
||||
this.token = await MintableToken.new({ from: owner });
|
||||
this.token = await MintableToken.new();
|
||||
await this.token.initialize(owner);
|
||||
|
||||
this.start = latestTime() + duration.minutes(1); // +1 minute so it starts after contract instantiation
|
||||
this.cliff = duration.years(1);
|
||||
this.duration = duration.years(2);
|
||||
|
||||
this.vesting = await TokenVesting.new(beneficiary, this.start, this.cliff, this.duration, true, { from: owner });
|
||||
this.vesting = await TokenVesting.new();
|
||||
await this.vesting.initialize(owner, beneficiary, this.start, this.cliff, this.duration, true);
|
||||
|
||||
await this.token.mint(this.vesting.address, amount, { from: owner });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user