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,8 +2,8 @@ const { constants, expectEvent, expectRevert, time } = require('@openzeppelin/te
const { web3 } = require('@openzeppelin/test-helpers/src/setup');
const { expect } = require('chai');
const ERC20Mock = artifacts.require('ERC20Mock');
const VestingWallet = artifacts.require('VestingWallet');
const ERC20 = artifacts.require('$ERC20');
const { shouldBehaveLikeVesting } = require('./VestingWallet.behavior');
@ -51,7 +51,7 @@ contract('VestingWallet', function (accounts) {
describe('ERC20 vesting', function () {
beforeEach(async function () {
this.token = await ERC20Mock.new('Name', 'Symbol', this.mock.address, amount);
this.token = await ERC20.new('Name', 'Symbol');
this.getBalance = (account) => this.token.balanceOf(account);
this.checkRelease = (receipt, to, value) => expectEvent.inTransaction(
receipt.tx,
@ -59,6 +59,8 @@ contract('VestingWallet', function (accounts) {
'Transfer',
{ from: this.mock.address, to, value },
);
await this.token.$_mint(this.mock.address, amount);
});
shouldBehaveLikeVesting(beneficiary);