Use hardhat-exposed to reduce the need for mocks (#3666)

Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
Hadrien Croubois
2023-01-03 15:38:13 +01:00
committed by GitHub
parent a81b0d0b21
commit c1d9da4052
190 changed files with 2297 additions and 4311 deletions

View File

@ -2,7 +2,7 @@ const { BN, expectRevert, time } = require('@openzeppelin/test-helpers');
const { expect } = require('chai');
const ERC20Mock = artifacts.require('ERC20Mock');
const ERC20 = artifacts.require('$ERC20');
const TokenTimelock = artifacts.require('TokenTimelock');
contract('TokenTimelock', function (accounts) {
@ -15,7 +15,7 @@ contract('TokenTimelock', function (accounts) {
context('with token', function () {
beforeEach(async function () {
this.token = await ERC20Mock.new(name, symbol, beneficiary, 0); // We're not using the preminted tokens
this.token = await ERC20.new(name, symbol);
});
it('rejects a release time in the past', async function () {
@ -30,7 +30,7 @@ contract('TokenTimelock', function (accounts) {
beforeEach(async function () {
this.releaseTime = (await time.latest()).add(time.duration.years(1));
this.timelock = await TokenTimelock.new(this.token.address, beneficiary, this.releaseTime);
await this.token.mint(this.timelock.address, amount);
await this.token.$_mint(this.timelock.address, amount);
});
it('can get state', async function () {