Use hardhat-exposed to reduce the need for mocks (#3666)
Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
@ -7,9 +7,9 @@ const {
|
||||
shouldSupportInterfaces,
|
||||
} = require('../../utils/introspection/SupportsInterface.behavior');
|
||||
|
||||
const Token = artifacts.require('ERC20VotesMock');
|
||||
const Token = artifacts.require('$ERC20Votes');
|
||||
const Timelock = artifacts.require('TimelockController');
|
||||
const Governor = artifacts.require('GovernorTimelockControlMock');
|
||||
const Governor = artifacts.require('$GovernorTimelockControlMock');
|
||||
const CallReceiver = artifacts.require('CallReceiverMock');
|
||||
|
||||
contract('GovernorTimelockControl', function (accounts) {
|
||||
@ -32,14 +32,15 @@ contract('GovernorTimelockControl', function (accounts) {
|
||||
beforeEach(async function () {
|
||||
const [ deployer ] = await web3.eth.getAccounts();
|
||||
|
||||
this.token = await Token.new(tokenName, tokenSymbol);
|
||||
this.token = await Token.new(tokenName, tokenSymbol, tokenName);
|
||||
this.timelock = await Timelock.new(3600, [], [], deployer);
|
||||
this.mock = await Governor.new(
|
||||
name,
|
||||
this.token.address,
|
||||
votingDelay,
|
||||
votingPeriod,
|
||||
0,
|
||||
this.timelock.address,
|
||||
this.token.address,
|
||||
0,
|
||||
);
|
||||
this.receiver = await CallReceiver.new();
|
||||
@ -61,7 +62,7 @@ contract('GovernorTimelockControl', function (accounts) {
|
||||
await this.timelock.grantRole(EXECUTOR_ROLE, constants.ZERO_ADDRESS);
|
||||
await this.timelock.revokeRole(TIMELOCK_ADMIN_ROLE, deployer);
|
||||
|
||||
await this.token.mint(owner, tokenSupply);
|
||||
await this.token.$_mint(owner, tokenSupply);
|
||||
await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner });
|
||||
await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner });
|
||||
await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner });
|
||||
@ -245,7 +246,7 @@ contract('GovernorTimelockControl', function (accounts) {
|
||||
describe('onlyGovernance', function () {
|
||||
describe('relay', function () {
|
||||
beforeEach(async function () {
|
||||
await this.token.mint(this.mock.address, 1);
|
||||
await this.token.$_mint(this.mock.address, 1);
|
||||
});
|
||||
|
||||
it('is protected', async function () {
|
||||
|
||||
Reference in New Issue
Block a user