I am using test-environment
and test-helpers
in a Mocha test suite and I cannot figure out how to interact with a role from my tests.
In my smart contract I setup the WHITELISTED
role:
bytes32 public constant WHITELISTED = keccak256("WHITELISTED");
constructor(uint256 _initialSupply) ERC20PresetMinterPauser("ExperimenDAO", "EXD") {
_setupRole(WHITELISTED, msg.sender);
_mint(msg.sender, _initialSupply * 10 ** 18);
}
in my test suite I am trying to set an account to have the WHITELISTED
role:
beforeEach(async function() {
this.experimenDAOToken = await ExperimenDAOToken.new(1000000, { from: owner });
await this.experimenDAOToken.grantRole(this.experimenDAOToken.WHITELISTED, whitelisted1);
});
With setup I am getting errors when I call grantRole()
and I cannot figure out what's going on. Any thoughts? Thanks!