Fix/whitelisted crowdsale (#981)

* fix: swithc WhitelistedCrowdsale to use Whitelist.sol

* feat: refactor whitelist.sol, rbac.sol and whitelistedcrowdsale.sol

* feat: add event arg assets and update whitelist

* fix: update modifier comment and also test isWhitelisted

* fix: remove onlyWhitelisted backwards compat attempt, fix explicit inheritance

* fix: remove underscore prefix from event args

* fix: user access/Whitelist
This commit is contained in:
Matt Condon
2018-06-15 14:11:50 -07:00
committed by GitHub
parent ee78f67985
commit 92b695f2fb
8 changed files with 98 additions and 131 deletions

View File

@ -1,14 +1,18 @@
const assert = require('chai').assert;
const should = require('chai').should();
const inLogs = async (logs, eventName) => {
const inLogs = async (logs, eventName, eventArgs = {}) => {
const event = logs.find(e => e.event === eventName);
assert.exists(event);
should.exist(event);
for (const [k, v] of Object.entries(eventArgs)) {
should.exist(event.args[k]);
event.args[k].should.eq(v);
}
return event;
};
const inTransaction = async (tx, eventName) => {
const inTransaction = async (tx, eventName, eventArgs = {}) => {
const { logs } = await tx;
return inLogs(logs, eventName);
return inLogs(logs, eventName, eventArgs);
};
module.exports = {