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

@ -1,13 +1,15 @@
const {
DEFAULT_ADMIN_ROLE,
shouldBehaveLikeAccessControl,
shouldBehaveLikeAccessControlEnumerable,
} = require('./AccessControl.behavior.js');
const AccessControlMock = artifacts.require('AccessControlEnumerableMock');
const AccessControlEnumerable = artifacts.require('$AccessControlEnumerable');
contract('AccessControl', function (accounts) {
beforeEach(async function () {
this.accessControl = await AccessControlMock.new({ from: accounts[0] });
this.accessControl = await AccessControlEnumerable.new({ from: accounts[0] });
await this.accessControl.$_grantRole(DEFAULT_ADMIN_ROLE, accounts[0]);
});
shouldBehaveLikeAccessControl('AccessControl', ...accounts);